Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QBluetoothPasskeyAgent Class Reference
[QtBluetoothModule]

The QBluetoothPasskeyAgent class represents a passkey entry proxy. More...

    #include <QBluetoothPasskeyAgent>

Inherits QObject.

Public Types

  • enum Error { NoError, AlreadyExists, DoesNotExist, UnknownAddress, UnknownError }

Public Functions

  • 29 public functions inherited from QObject

Protected Functions

  • virtual void cancelRequest ( const QString & localDevice, const QBluetoothAddress & remoteAddr )
  • virtual bool confirmPasskey ( const QString & localDevice, const QBluetoothAddress & remoteAddr, const QString & passkey )
  • virtual void release ()
  • virtual void requestPasskey ( QBluetoothPasskeyRequest & request ) = 0
  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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.


Member Type Documentation

enum QBluetoothPasskeyAgent::Error

Possible errors that might occur.

ConstantValueDescription
QBluetoothPasskeyAgent::NoError0No error.
QBluetoothPasskeyAgent::AlreadyExists1Another passkey agent has already been registered.
QBluetoothPasskeyAgent::DoesNotExist2The passkey agent has not been registered.
QBluetoothPasskeyAgent::UnknownAddress3The address of the remote device is unknown.
QBluetoothPasskeyAgent::UnknownError4An unknown error has occurred.


Member Function Documentation

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

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.

QBluetoothPasskeyAgent::~QBluetoothPasskeyAgent ()   [virtual]

Destroys the passkey agent.

void QBluetoothPasskeyAgent::cancelRequest ( const QString & localDevice, const QBluetoothAddress & remoteAddr )   [virtual protected]

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().

bool QBluetoothPasskeyAgent::confirmPasskey ( const QString & localDevice, const QBluetoothAddress & remoteAddr, const QString & passkey )   [virtual protected]

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().

QBluetoothPasskeyAgent::Error QBluetoothPasskeyAgent::error () const

Returns the last error that has occurred.

QString QBluetoothPasskeyAgent::name () const

Returns the name of the passkey agent as a string.

bool QBluetoothPasskeyAgent::registerDefault ()

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().

bool QBluetoothPasskeyAgent::registerDefault ( const QString & localDevice )

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().

bool QBluetoothPasskeyAgent::registerForAddress ( QBluetoothAddress & addr )

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().

bool QBluetoothPasskeyAgent::registerForAddress ( const QString & localDevice, QBluetoothAddress & addr )

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().

void QBluetoothPasskeyAgent::release ()   [virtual protected]

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

See also unregisterDefault() and unregisterForAddress().

void QBluetoothPasskeyAgent::requestPasskey ( QBluetoothPasskeyRequest & request )   [pure virtual protected]

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().

bool QBluetoothPasskeyAgent::unregisterDefault ()

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().

bool QBluetoothPasskeyAgent::unregisterDefault ( const QString & localDevice )

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().

bool QBluetoothPasskeyAgent::unregisterForAddress ( QBluetoothAddress & addr )

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().

bool QBluetoothPasskeyAgent::unregisterForAddress ( const QString & localDevice, QBluetoothAddress & addr )

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().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 80
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le Qt Developer Network au hasard

Logo

Combiner licence, à propos et fermer d'une dernière manière

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web