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

Defining the BroadcasterChannel API

We want to define a common API for all broadcaster channels that we might want to implement, be it Bluetooth, Wi-Fi, or any other technology. To do so, we will have to define at least:

  • A way to connect a Channel to an Broadcaster entity, so that the channel can listen to any changes in the entity to behave accordingly — for example, when the entity emits a readingsPublished signal
  • A way to implement the behavior — for example, by means of a slot

We will call the first connectToBroadcaster, and the second sendReadings(QList<QVariantMap>).

Since we are dealing with devices that rely on system APIs, we will also want to check that instances are instantiated and initialized correctly, and the same for their ...

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