Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QBluetoothPasskeyAgent class represents a passkey entry proxy. More...
#include <QBluetoothPasskeyAgent>
Inherits QObject.
The QBluetoothPasskeyAgent class represents a passkey entry proxy.
The QBluetoothPasskeyAgent class provides an abstract interface for requesting and providing passkeys to the bluetooth system whenever a new pairing procedure is initiated. It is up to the clients to actually establish how the passkey is obtained. For instance, the client could ask the user, or read passkeys from a file, or by presenting the user with a dialog box, or in some other fashion.
The passkey agent can be registered as a global default, a default for a particular local bluetooth adapter, or just for a specific remote device.
See also QBluetoothAddress, QBluetoothLocalDevice, and QBluetoothPasskeyRequest.
Possible errors that might occur.
Constant | Value | Description |
---|---|---|
QBluetoothPasskeyAgent::NoError | 0 | No error. |
QBluetoothPasskeyAgent::AlreadyExists | 1 | Another passkey agent has already been registered. |
QBluetoothPasskeyAgent::DoesNotExist | 2 | The passkey agent has not been registered. |
QBluetoothPasskeyAgent::UnknownAddress | 3 | The address of the remote device is unknown. |
QBluetoothPasskeyAgent::UnknownError | 4 | An unknown error has occurred. |
Constructs a passkey agent. The name parameter specifies a unique name of the passkey agent. The name should be a valid identifier name, e.g. it cannot contain special characters or start with a number. For instance: DefaultPasskeyAgent.
The parent parameter holds the QObject parent.
Destroys the passkey agent.
This function will be called whenever a passkey authentication request has failed.
The request being cancelled is on localDevice and the address of the paired device is remoteAddr. The localDevice is of the form hciX, and can be used to construct a QBluetoothLocalDevice object.
See also confirmPasskey() and requestPasskey().
This function will be called whenever a passkey needs to be confirmed by the user. The request came in on localDevice and the address of the paired device is remoteAddr. The localDevice is of the form hciX, and can be used to construct a QBluetoothLocalDevice object. The passkey contains the passkey that should be confirmed.
The method should return true if the passkeys match, and false otherwise.
See also requestPasskey() and cancelRequest().
Returns the last error that has occurred.
Returns the name of the passkey agent as a string.
Register the passkey agent as the default agent for all local devices.
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 unregisterDefault() and error().
This is an overloaded member function, provided for convenience.
Register the passkey agent as the default agent for device given by localDevice. The localDevice is of the form hciX, and can be used to construct a 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 unregisterDefault() and error().
Register the passkey agent for all local devices. It will only handle pairing requests associated with remote device which is given in addr.
Note that once pairing is complete, or a timeout has been hit, the agent will be automatically unregistered. The release() method will be called. It is up to the application to register the agent again.
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 unregisterForAddress() and error().
This is an overloaded member function, provided for convenience.
Register the passkey agent for local device represented by localDevice. The localDevice is of the form hciX, and can be used to construct a QBluetoothLocalDevice object. It will only handle pairing requests associated with remote device which is given in addr.
Note that once pairing is complete, or a timeout has been hit, the agent will be automatically unregistered. The release() method will be called. It is up to the application to register the agent again.
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 unregisterForAddress() and error().
This function will be called whenever a passkey agent has been unregistered.
See also unregisterDefault() and unregisterForAddress().
This virtual function will be called whenever the bluetooth system has received a request for a passkey, and the agent is registered to handle the particular request.
The request parameter contains the passkey request. Please see the QBluetoothPasskeyRequest documentation for more details on how to handle the request.
See also confirmPasskey() and cancelRequest().
Unregister the passkey agent as the default agent for all local devices.
Returns true if the agent could be unregistered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().
See also registerDefault() and error().
This is an overloaded member function, provided for convenience.
Unregister the passkey agent as the default agent for device given by localDevice. The localDevice is of the form hciX, and can be used to construct a QBluetoothLocalDevice object.
Returns true if the agent could be unregistered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().
See also registerDefault() and error().
Unregister the passkey agent for all local devices. This method attempts to unregister an agent that would have only handled pairing requests associated with remote device at address addr.
Returns true if the agent could be unregistered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().
See also registerForAddress() and error().
This is an overloaded member function, provided for convenience.
Unregister the passkey agent for local device localDevice. The localDevice is of the form hciX, and can be used to construct a QBluetoothLocalDevice object. This method attempts to unregister an agent that would have only handled pairing requests associated with remote device at address addr.
Returns true if the agent could be unregistered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().
See also registerForAddress() and error().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |