MQTT ready to use
change subscription logic - now keep subscriptions independently from connecting state. No unregisters on disconnect, but resubscriptions on connect. So one-time subscription on app start and just connect() on lost connection - all subscriptions keeps
This commit is contained in:
@@ -50,7 +50,6 @@ public:
|
||||
void connect(const PIString & address, const PIString & client, const PIString & username = {}, const PIString & password = {});
|
||||
void disconnect();
|
||||
|
||||
|
||||
void subscribe(const PIString & topic, MessageFunction functor, QoS qos = QoS::Level1);
|
||||
|
||||
template<typename T>
|
||||
@@ -68,6 +67,8 @@ public:
|
||||
bool isConnecting() const { return m_status == Connecting; }
|
||||
bool isConnected() const { return m_status == Connected; }
|
||||
|
||||
PIStringList usedTopics() const;
|
||||
|
||||
EVENT0(connected);
|
||||
EVENT1(disconnected, PIMQTT::Error, code);
|
||||
EVENT1(receivedUnhandled, PIMQTT::MessageConst, message);
|
||||
|
||||
Reference in New Issue
Block a user