BluezQt 5.109.0
Public Member Functions | List of all members
BluezQt::ObexAgentabstract

Bluetooth OBEX agent. More...

#include <BluezQt/ObexAgent>

Public Member Functions

 ObexAgent (QObject *parent=nullptr)
 Creates a new ObexAgent object.
 
virtual void authorizePush (ObexTransferPtr transfer, ObexSessionPtr session, const Request< QString > &request)
 Requests the agent to authorize an incoming object push request.
 
virtual void cancel ()
 Indicate that the agent request failed before receiving reply.
 
virtual QDBusObjectPath objectPath () const =0
 D-Bus object path of the agent.
 
virtual void release ()
 Indicates that the agent was unregistered.
 

Detailed Description

Bluetooth OBEX agent.

This class represents a Bluetooth OBEX agent.

The agent is used to authorize an incoming object push requests.

Note
The return value of request will be sent asynchronously with Request class. It is also possible to cancel/reject the request.

Constructor & Destructor Documentation

◆ ObexAgent()

BluezQt::ObexAgent::ObexAgent ( QObject *  parent = nullptr)
explicit

Creates a new ObexAgent object.

Parameters
parent

Member Function Documentation

◆ authorizePush()

virtual void BluezQt::ObexAgent::authorizePush ( ObexTransferPtr  transfer,
ObexSessionPtr  session,
const Request< QString > &  request 
)
virtual

Requests the agent to authorize an incoming object push request.

This method gets called when the Bluetooth daemon needs to accept/reject a Bluetooth object push request.

The return value should be full path where the incoming object will be saved.

The ObexTransfer::fileName() contains the default location and name that can be returned.

You can use session to get device and adapter this transfer belongs to.

Parameters
transfertransfer object
sessiontransfer session
requestrequest to be used for sending reply

◆ cancel()

virtual void BluezQt::ObexAgent::cancel ( )
virtual

Indicate that the agent request failed before receiving reply.

This method gets called to indicate that the agent request failed before a reply was returned.

It cancels the previous request.

◆ objectPath()

virtual QDBusObjectPath BluezQt::ObexAgent::objectPath ( ) const
pure virtual

D-Bus object path of the agent.

The path where the agent will be registered.

Note
You must provide valid object path!
Returns
object path of agent

◆ release()

virtual void BluezQt::ObexAgent::release ( )
virtual

Indicates that the agent was unregistered.

This method gets called when the Bluetooth daemon unregisters the agent.

An agent can use it to do cleanup tasks. There is no need to unregister the agent, because when this method gets called it has already been unregistered.