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

Connecting the broadcaster channel to the Broadcaster entity

We add a test to the BT channel's test suite to verify that a Bluetooth channel connects successfully to a broadcaster_entity:

void Channel_broadcasterBt::test_connectToBroadcaster(){    auto broadcaster_entity = new entities::Broadcaster();    QVERIFY(_broadcaster_bt->connectToBroadcaster(broadcaster_entity));    delete broadcaster_entity;}

Since for our purposes connectToBroadcaster will be the same, independent of the underlying technological stack, we add it to the BroadcasterChannel base class:

#ifndef BROADCASTER_CHANNEL_H#define BROADCASTER_CHANNEL_H...namespace entities {class Broadcaster;}namespace channels {class BroadcasterChannel : public QObject{    ...public: virtual bool init() ...

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