QBluetoothDeviceDiscoveryAgent ClassThe QBluetoothDeviceDiscoveryAgent class discovers the Bluetooth devices nearby. More... #include <QBluetoothDeviceDiscoveryAgent> Inherits: QObject. Public Types
Properties
Public Functions
Public Slots
Signals
Additional Inherited MembersDetailed DescriptionThe QBluetoothDeviceDiscoveryAgent class discovers the Bluetooth devices nearby. To discover the nearby Bluetooth devices:
To retrieve results asynchronously, connect to the deviceDiscovered() signal. To get a list of all discovered devices, call discoveredDevices() after the finished() signal. Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QBluetoothDeviceDiscoveryAgent::NoError | 0 | No error has occurred. |
QBluetoothDeviceDiscoveryAgent::PoweredOff | 2 | The Bluetooth adaptor is powered off, power it on before doing discovery. |
QBluetoothDeviceDiscoveryAgent::IOFailure | 1 | Writing or reading from the device resulted in an error. |
QBluetoothDeviceDiscoveryAgent::UnknownError | 100 | An unknown error has occurred. |
This enum describes the inquiry type used while discovering Bluetooth devices.
Constant | Value | Description |
---|---|---|
QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry | 0 | A general unlimited inquiry. Discovers all visible Bluetooth devices in the local vicinity. |
QBluetoothDeviceDiscoveryAgent::LimitedInquiry | 1 | A limited inquiry discovers devices that are in limited inquiry mode. |
LimitedInquiry is not supported on all platforms. If it is requested on a platform that does not support it, GeneralUnlimitedInquiry will be used instead. Setting LimitedInquiry is useful for multi-player Bluetooth-based games that needs faster communication between the devices. The phone scans for devices in LimitedInquiry and Service Discovery is done on one or two devices to speed up the service scan. After the game has connected to the device it intends to,the device returns to GeneralUnilimitedInquiry.
This property holds type of inquiry scan to be used while discovering devices.
This property affects the type of inquiry scan which is performed while discovering devices.
By default, this property is set to GeneralUnlimitedInquiry.
Not all platforms support LimitedInquiry.
Access functions:
QBluetoothDeviceDiscoveryAgent::InquiryType | inquiryType() const |
void | setInquiryType(QBluetoothDeviceDiscoveryAgent::InquiryType type) |
See also InquiryType.
Constructs a new Bluetooth device discovery agent with parent parent.
Destructor for ~QBluetoothDeviceDiscoveryAgent()
This signal is emitted when device discovery is aborted by a call to stop().
This signal is emitted when the Bluetooth device described by info is discovered.
Returns a list of all discovered Bluetooth devices.
Returns the last error.
This signal is emitted when an error occurs during Bluetooth device discovery.
See also error() and errorString().
Returns a human-readable description of the last error.
This signal is emitted when Bluetooth device discovery completes.
Returns true if the agent is currently discovering Bluetooth devices, otherwise returns false.
Starts Bluetooth device discovery, if it is not already started.
The deviceDiscovered() signal is emitted as each device is discovered. The finished() signal is emitted once device discovery is complete.
Stops Bluetooth device discovery. The cancel() signal is emitted once the device discovery is canceled. start() maybe called before the cancel signal is received. Once start() has been called the cancel signal from the prior discovery will be discarded.