O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Registering the service with the adapter

After all the setting up, the service can finally be registered with the adapter.

Keep in mind that if you ever need to change any attribute in the service info, you will have to re-register the service.

This is done by calling the registerService method of the QBluetoothServiceInfo instance:

bool channels::BroadcasterBt::_registerService(){    qDebug() << Q_FUNC_INFO;    bool success = _serviceInfo.registerService(_localAdapter);    if (success) qDebug()            << "registered service" << _serviceInfo.serviceName()            << "on adapter" << _localAdapter.toString();    return success;}

If the service was registered successfully, we will print a message with qDebug, showing the service name and the adapter's address.

Now that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required