QBluetoothServiceDiscoveryAgent Class ReferenceThe QBluetoothServiceDiscoveryAgent class provides an API for querying the services provided by a Bluetooth device. More... #include <QBluetoothServiceDiscoveryAgent> Inherits: QObject. This class was introduced in Qt Mobility 1.2. Public Types
Public Functions
Public Slots
Signals
Additional Inherited Members
Detailed DescriptionThe QBluetoothServiceDiscoveryAgent class provides an API for querying the services provided by a Bluetooth device. To query the services provided by all contactable Bluetooth devices create an instance of QBluetoothServiceDiscoveryAgent, connect to either the serviceDiscovered() or finished() signals and call start(). QBluetoothServiceDiscoveryAgent *discoveryAgent = new QBluetoothServiceDiscoveryAgent(this); connect(discoveryAgent, SIGNAL(serviceDiscovered(const QBluetoothServiceInfo&)), this, SLOT(serviceDiscovered(const QBluetoothServiceInfo&))); // Automatically delete agent when service discovery finishes. connect(discoveryAgent, SIGNAL(finished()), this, SLOT(deleteLater())); discoveryAgent->start(); By default a minimal service discovery is performed. In this mode the QBluetotohServiceInfo objects returned are guaranteed to contain only device and service UUID information. Depending on platform and device capabilities other service information may also be available. For most use cases this is adequate as QBluetoothSocket::connectToService() will perform additional discovery if required. If full service information is required pass FullDiscovery as the discoveryMode parameter to start(). Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QBluetoothServiceDiscoveryAgent::MinimalDiscovery | 0 | Performs a minimal service discovery. The QBluetoothServiceInfo objects returned may be incomplete and are only guaranteed to contain device and service UUID information. |
QBluetoothServiceDiscoveryAgent::FullDiscovery | 1 | Performs a full service discovery. |
This enum describes errors that can occur during service discovery.
Constant | Value | Description |
---|---|---|
QBluetoothServiceDiscoveryAgent::NoError | 0 | No error. |
QBluetoothServiceDiscoveryAgent::DeviceDiscoveryError | 1 | Error occurred during device discovery. |
QBluetoothServiceDiscoveryAgent::UnknownError | 100 | An unidentified error occurred. |
Constructs a new QBluetoothServiceDiscoveryAgent with parent. Services will be discovered on all contactable devices.
Constructs a new QBluetoothServiceDiscoveryAgent for remoteAddress and with parent.
If remoteAddress is null services will be discovred on all contactable Bluetooth devices.
Destructor for QBluetoothServiceDiscoveryAgent
Signals the cancellation of the service discovery.
Clears the results of a previous service discovery.
Returns the list of all discovered services.
Returns the type of error that last occurred. If service discovery is done on a signle address it will returns errors when trying to discover services on that device. If the alternate constructor is used and devices are discovered by a scan, then errors doing service discovery on individual devices are not saved and no signals are emitted. In this case errors are fairly normal since some devices may not respond to discovery or may no longer be in range. As such errors are surpressed. If no services are returned, it can be assumed no services could be discovered.
This signal is emitted when an error occurs. The error parameter describes the error that occurred.
Returns a human-readable description of the last error that occurred when doing service discovery on a single device.
This signal is emitted when Bluetooth service discovery completes.
Returns true if service discovery is currently active, otherwise returns false.
This signal is emitted when the Bluetooth service described by info is discovered.
Sets the UUID filter to uuids. Only services matching the UUIDs in uuids will be returned.
An empty UUID list is equivalent to a list containing only QBluetoothUuid::PublicBrowseGroup.
See also uuidFilter().
This is an overloaded member function, provided for convenience.
Sets the UUID filter to a list containing the single element uuid.
See also uuidFilter().
Starts service discovery. mode specifies the type of service discovery to perform.
See also DiscoveryMode.
Stops service discovery.
Returns the UUID filter.
See also setUuidFilter().
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 qtmobility-1.2 | |
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 ! |
Copyright © 2000-2012 - www.developpez.com