![]() |
QBluetoothZero
2.0
|
#include <QBtServiceDiscoverer.h>
This class provides the mechanism to inquire a given device for the bluetooth services it supports.
If startDiscovery (const QBtDevice &) is called, then the device is inquired for all the bluetooth services it supports.
If user is searching for a specific service then startDiscovery (const QBtDevice &, const QBtUuid &) or startDiscovery (const QBtDevice &, QBtConstants::ServiceProtocol) can be called, according to the information the user already has about the inquired service. After the successful call of these functions, discoveryStarted() signal is emitted.
At any of the above cases, a found service is reported through newServiceFound (const QBtDevice &, const QBtService &) signal.
If service inquiring stops (either by the user calling stopDiscovery() or by normal termination of the inquiring) then discoveryStopped() signal is emitted.
At any time the user can access the found services through getInquiredServices().
QBtServiceDiscoverer::QBtServiceDiscoverer | ( | QObject * | parent = 0 | ) |
virtual QBtServiceDiscoverer::~QBtServiceDiscoverer | ( | ) | [virtual] |
void QBtServiceDiscoverer::discoveryStarted | ( | ) | [signal] |
Signal to report that discovery has started. Alternative is error.
void QBtServiceDiscoverer::discoveryStopped | ( | ) | [signal] |
Signal to report that discovery has stopped (either cancelled or no new devices to detect)
void QBtServiceDiscoverer::error | ( | QBtServiceDiscoverer::ServiceDiscoveryError | error | ) | [signal] |
Signal to be emitted when error occurs.
error | error code. |
QBtService::List QBtServiceDiscoverer::getInquiredServices | ( | ) |
Returns a service list containing the inquired services (if any)
const QBtDevice& QBtServiceDiscoverer::getTargetDevice | ( | ) | const |
Returns the remote device selected for service discovery. If "startDiscovery" function (both overloads) was already called then returns "targetDevice" which was passed as argument else returns NULL
bool QBtServiceDiscoverer::isBusy | ( | ) | const |
Returns true if a discovery operation is in progress.
void QBtServiceDiscoverer::newServiceFound | ( | const QBtDevice & | targetDevice, |
const QBtService & | service | ||
) | [signal] |
Signaled for every service detected The targetDevice's field "supportedServices" is updated every time this signal is emitted.
targetDevice | The remote device where the service was found |
service | The remote service found |
void QBtServiceDiscoverer::startDiscovery | ( | const QBtDevice & | targetDevice | ) | [slot] |
Starts service discovery for OBEX and RFCOMM services. New services found are reported through signal "newServiceFound" or can be acquired through "getInquiredServices" function
void QBtServiceDiscoverer::startDiscovery | ( | const QBtDevice & | targetDevice, |
const QBtUuid & | uuid | ||
) | [slot] |
Starts service discovery for the service (or protocol) identified by the uuid parameter. New services found are reported through signal "newServiceFound" or can be acquired through "getInquiredServices" function.
void QBtServiceDiscoverer::startDiscovery | ( | const QBtDevice & | targetDevice, |
const QList< QBtUuid > & | uuids | ||
) | [slot] |
Starts service discovery for UUIDs provided in the list. New services found are reported through signal "newServiceFound" or can be acquired through "getInquiredServices" function.
void QBtServiceDiscoverer::startObexDiscovery | ( | const QBtDevice & | targetDevice | ) | [slot] |
Starts service discovery for OBEX services only. New services found are reported through signal "newServiceFound" or can be aquired through "getInquiredServices" function
void QBtServiceDiscoverer::startRfcommDiscovery | ( | const QBtDevice & | targetDevice | ) | [slot] |
Starts service discovery for RFCOMM services only. New services found are reported through signal "newServiceFound" or can be acquired through "getInquiredServices" function.
void QBtServiceDiscoverer::stopDiscovery | ( | ) | [slot] |
Stops service discovery. Services found so far can be acquired using "getInquiredServices" function.
friend class QBtServiceDiscovererPrivate [friend] |