![]() |
QBluetoothZero
2.0
|
#include <QBtServiceAdvertiser.h>
Public Types | |
enum | ErrorCodes { FeatureNotSupported } |
Signals | |
void | advertisingStarted (const QBtService &service) |
void | advertisingStopped () |
void | error (QBtServiceAdvertiser::ErrorCodes code) |
Public Member Functions | |
QBtServiceAdvertiser (QObject *parent) | |
~QBtServiceAdvertiser () | |
void | startAdvertising (const QBtService &service) |
void | stopAdvertising () |
void | updateAvailability (bool aAvailable) |
Friends | |
class | QBtServiceAdvertiserPrivate |
Class responsible to advertise a given bluetooth service.
After the instantiation of the class, startAdvertising(const QBtService&) can be callled to start advertising the given bluetooth service. If successfull then advertisingStarted(const QBtService&) signal is emitted.
At any time stopAdvertising() can be called to stop the advertising and remove the registered service from the SDP database. If successfull then advertisingStopped() is emitted.
If user wants to temporarily deactive the service advertisement then he can call updateAvailability(bool) (instead of the stopAdvertising() that stops the advertising permanently).
In case of error, error(ErrorCodes) signal is emitted.
For integrity reasons, at destruction stops the advertising causing the service to be deleted from the SDP database.
NOTE: Currently there is no implementation on the Windows platform so after the intatiation of this object, any call to any function will emit an error(QBtServiceAdvertiser::FeatureNotSupported) signal.
QBtServiceAdvertiser::QBtServiceAdvertiser | ( | QObject * | parent | ) |
QBtServiceAdvertiser::~QBtServiceAdvertiser | ( | ) |
void QBtServiceAdvertiser::advertisingStarted | ( | const QBtService & | service | ) | [signal] |
The signal is emitted if the transmittion of the service is started
service | A reference to an object containing all the info of the service being transmitted. |
void QBtServiceAdvertiser::advertisingStopped | ( | ) | [signal] |
The signal is emitted when the transmittion of the service ends.
void QBtServiceAdvertiser::error | ( | QBtServiceAdvertiser::ErrorCodes | code | ) | [signal] |
Emitted in case of error (not implemented).
void QBtServiceAdvertiser::startAdvertising | ( | const QBtService & | service | ) |
Starts the service advertiser.
service | the service class that contains all the necessery information for transmitting the service |
void QBtServiceAdvertiser::stopAdvertising | ( | ) |
Stops the transmittion of the service running (if any)
void QBtServiceAdvertiser::updateAvailability | ( | bool | aAvailable | ) |
Change the availability of the service.
aAvailable | If true, the service is transmitted. |
friend class QBtServiceAdvertiserPrivate [friend] |