Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QBluetoothAuthorizationAgent Class Reference
[QtBluetoothModule]

The QBluetoothAuthorizationAgent class represents an authorization proxy. More...

    #include <QBluetoothAuthorizationAgent>

Inherits QObject.

Public Types

Public Functions

Protected Functions

Additional Inherited Members


Detailed Description

The QBluetoothAuthorizationAgent class represents an authorization proxy.

The QBluetoothAuthorizationAgent class provides an abstract interface for querying and granting authorization requests whenever remote bluetooth devices wish to use local bluetooth services. It is up to the clients of this class to actually establish whether the authorization request is granted or denied. For instance, the client could ask the user by informing him or her of the incoming request.

The authorization agent can be registered as a global for all local adapters or for a particular adapter.

See also QBluetoothAddress and QBluetoothLocalDevice.


Member Type Documentation

enum QBluetoothAuthorizationAgent::Error

Possible errors that might occur.

ConstantValueDescription
QBluetoothAuthorizationAgent::NoError0No error.
QBluetoothAuthorizationAgent::AlreadyExists1Another passkey agent has already been registered.
QBluetoothAuthorizationAgent::DoesNotExist2The passkey agent has not been registered.
QBluetoothAuthorizationAgent::UnknownError3An unknown error has occurred.


Member Function Documentation

QBluetoothAuthorizationAgent::QBluetoothAuthorizationAgent ( const QString & name, QObject * parent = 0 )

Constructs an authorization agent. The name parameter specifies a unique name of the authorization agent. The name should be a valid identifier name, e.g. it cannot contain special characters or start with a number. For instance: DefaultAuthAgent.

The parent parameter holds the QObject parent.

QBluetoothAuthorizationAgent::~QBluetoothAuthorizationAgent ()

Destroys the passkey agent.

bool QBluetoothAuthorizationAgent::authorize ( const QString & localDevice, const QBluetoothAddress & remote, const QString & service, const QString & uuid )   [pure virtual protected]

This virtual function will be called whenever the bluetooth system has received an authorization request, and the agent is registered to handle the particular request.

The localDevice parameter contains the local adapter this request came in on. The remote parameter contains the Bluetooth address of the remote device requesting authorization, and service parameter holds the name of the service the authorization is being obtained for. The uuid contains an optional uuid of the request.

This function should return true if the request is to be authorized and false otherwise.

See also cancel().

void QBluetoothAuthorizationAgent::cancel ( const QString & localDevice, const QBluetoothAddress & remote, const QString & service, const QString & uuid )   [virtual protected]

This function will be called whenever an authorization request has been canceled by the requestor (e.g. connection to the service has been dropped).

The request being cancelled is on localDevice and remote is the address of the remote device. The service is the service name of the service canceling the authorization request. The uuid contains an optional uuid of the request.

See also authorize().

QBluetoothAuthorizationAgent::Error QBluetoothAuthorizationAgent::error () const

Returns the last error that has occurred.

QString QBluetoothAuthorizationAgent::name () const

Returns the name of the passkey agent as a string.

bool QBluetoothAuthorizationAgent::registerAgent ()

Register the authorization agent for all local adapters.

Returns true if the agent cou7ld be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also unregisterAgent() and error().

bool QBluetoothAuthorizationAgent::registerAgent ( const QString & localDevice )

This is an overloaded member function, provided for convenience.

Register the authorization agent for localDevice adapter. The adapter name can be obtained from the QBluetoothLocalDevice object.

Returns true if the agent could be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also unregisterAgent(), error(), and QBluetoothLocalDevice.

void QBluetoothAuthorizationAgent::release ()   [virtual protected]

This function will be called whenever a passkey agent has been unregistered.

See also unregisterAgent().

bool QBluetoothAuthorizationAgent::unregisterAgent ()

Unregister the authorization agent for all local adapters.

Returns true if the agent could be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also registerAgent() and error().

bool QBluetoothAuthorizationAgent::unregisterAgent ( const QString & localDevice )

This is an overloaded member function, provided for convenience.

Unregister the authorization agent for localDevice adapter. The adapter name can be obtained from the QBluetoothLocalDevice object.

Returns true if the agent could be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also unregisterAgent(), error(), and QBluetoothLocalDevice.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3