QBluetoothZero  2.0
QBtServiceDiscoverer Class Reference

#include <QBtServiceDiscoverer.h>

List of all members.

Public Types

enum  ServiceDiscoveryError {
  ServiceDiscoveryNotAbleToComplete, UnableToRetrieveServiceAttributes, ProblemRequestingNextServiceRecord, ProblemAcquiringNextServiceAttributes,
  NotSupported, NoDeviceSelected, UnknownError
}

Public Slots

void startDiscovery (const QBtDevice &targetDevice)
void startObexDiscovery (const QBtDevice &targetDevice)
void startRfcommDiscovery (const QBtDevice &targetDevice)
void startDiscovery (const QBtDevice &targetDevice, const QBtUuid &uuid)
void startDiscovery (const QBtDevice &targetDevice, const QList< QBtUuid > &uuids)
void stopDiscovery ()

Signals

void discoveryStarted ()
void discoveryStopped ()
void newServiceFound (const QBtDevice &targetDevice, const QBtService &service)
void error (QBtServiceDiscoverer::ServiceDiscoveryError error)

Public Member Functions

 QBtServiceDiscoverer (QObject *parent=0)
virtual ~QBtServiceDiscoverer ()
QBtService::List getInquiredServices ()
const QBtDevicegetTargetDevice () const
bool isBusy () const

Friends

class QBtServiceDiscovererPrivate

Detailed Description

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


Member Enumeration Documentation

Enumerator:
ServiceDiscoveryNotAbleToComplete 
UnableToRetrieveServiceAttributes 
ProblemRequestingNextServiceRecord 
ProblemAcquiringNextServiceAttributes 
NotSupported 
NoDeviceSelected 
UnknownError 

Constructor & Destructor Documentation

QBtServiceDiscoverer::QBtServiceDiscoverer ( QObject *  parent = 0)
virtual QBtServiceDiscoverer::~QBtServiceDiscoverer ( ) [virtual]

Member Function Documentation

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.

Parameters:
errorerror code.
QBtService::List QBtServiceDiscoverer::getInquiredServices ( )

getInquiredServices()

Returns a service list containing the inquired services (if any)

const QBtDevice& QBtServiceDiscoverer::getTargetDevice ( ) const

getTargetDevice()

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.

Parameters:
targetDeviceThe remote device where the service was found
serviceThe 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.


Friends And Related Function Documentation

friend class QBtServiceDiscovererPrivate [friend]

The documentation for this class was generated from the following file: