|
SNode.C
|
#include <Mqtt.h>
Public Types | |
| using | Super = iot::mqtt::Mqtt |
Public Member Functions | |
| Mqtt (const std::string &connectionName, const std::string &clientId, uint16_t keepAlive, const std::string &sessionStoreFileName) | |
| ~Mqtt () override | |
| void | sendConnect (bool cleanSession, const std::string &willTopic, const std::string &willMessage, uint8_t willQoS, bool willRetain, const std::string &username, const std::string &password, bool loopPrevention=false) const |
| void | sendSubscribe (const std::list< Topic > &topics) const |
| void | sendUnsubscribe (const std::list< std::string > &topics) const |
| void | sendPingreq () const |
| void | sendDisconnect () const |
Public Member Functions inherited from iot::mqtt::Mqtt | |
| Mqtt (const std::string &connectionName) | |
| Mqtt (const std::string &connectionName, const std::string &clientId) | |
| Mqtt (Mqtt &&)=delete | |
| Mqtt (const Mqtt &)=delete | |
| Mqtt & | operator= (Mqtt &&)=delete |
| Mqtt & | operator= (const Mqtt &)=delete |
| virtual void | onConnected () |
| virtual void | onDisconnected () |
| const std::string & | getConnectionName () const |
| const MqttContext * | getMqttContext () const |
| void | sendPublish (const std::string &topic, const std::string &message, uint8_t qoS, bool retain) const |
| void | sendPuback (uint16_t packetIdentifier) const |
| void | sendPubrec (uint16_t packetIdentifier) const |
| void | sendPubrel (uint16_t packetIdentifier) const |
| void | sendPubcomp (uint16_t packetIdentifier) const |
Protected Attributes | |
| uint16_t | keepAlive = 0 |
Protected Attributes inherited from iot::mqtt::Mqtt | |
| std::string | connectionName |
| std::string | clientId |
| MqttContext * | mqttContext = nullptr |
Private Member Functions | |
| iot::mqtt::ControlPacketDeserializer * | createControlPacketDeserializer (iot::mqtt::FixedHeader &fixedHeader) final |
| void | deliverPacket (iot::mqtt::ControlPacketDeserializer *controlPacketDeserializer) override |
| virtual void | onConnack (const iot::mqtt::packets::Connack &connack) |
| virtual void | onSuback (const iot::mqtt::packets::Suback &suback) |
| virtual void | onUnsuback (const iot::mqtt::packets::Unsuback &unsuback) |
| virtual void | onPingresp (const iot::mqtt::packets::Pingresp &pingresp) |
| void | _onConnack (const iot::mqtt::client::packets::Connack &connack) |
| void | _onPublish (const iot::mqtt::client::packets::Publish &publish) |
| void | _onSuback (const iot::mqtt::client::packets::Suback &suback) |
| void | _onUnsuback (const iot::mqtt::client::packets::Unsuback &unsuback) |
| void | _onPingresp (const iot::mqtt::client::packets::Pingresp &pingresp) |
Private Attributes | |
| std::string | sessionStoreFileName |
| iot::mqtt::Session | session |
| core::timer::Timer | pingTimer |
Additional Inherited Members | |
Static Public Member Functions inherited from iot::mqtt::Mqtt | |
| static std::string | toHexString (const std::vector< char > &data) |
| static std::string | toHexString (const std::string &data) |
|
explicit |
Definition at line 78 of file Mqtt.cpp.
References iot::mqtt::Session::clear(), iot::mqtt::Session::fromJson(), keepAlive, iot::mqtt::Mqtt::Mqtt(), session, and sessionStoreFileName.
|
overridevirtual |
Reimplemented from iot::mqtt::Mqtt.
Definition at line 113 of file Mqtt.cpp.
References core::Timer::cancel(), iot::mqtt::Mqtt::connectionName, pingTimer, session, sessionStoreFileName, and iot::mqtt::Session::toJson().
|
private |
Definition at line 194 of file Mqtt.cpp.
References iot::mqtt::Mqtt::connectionName, iot::mqtt::packets::Connack::getAcknowledgeFlags(), iot::mqtt::packets::Connack::getReturnCode(), iot::mqtt::packets::Connack::getSessionPresent(), iot::mqtt::Mqtt::initSession(), core::timer::Timer::intervalTimer(), keepAlive, onConnack(), core::timer::Timer::operator=(), pingTimer, sendPingreq(), and session.
Referenced by iot::mqtt::client::packets::Connack::deliverPacket().
|
private |
Definition at line 258 of file Mqtt.cpp.
References onPingresp().
Referenced by iot::mqtt::client::packets::Pingresp::deliverPacket().
|
private |
Definition at line 214 of file Mqtt.cpp.
References iot::mqtt::Mqtt::_onPublish(), and iot::mqtt::Mqtt::onPublish().
Referenced by iot::mqtt::client::packets::Publish::deliverPacket().
|
private |
Definition at line 220 of file Mqtt.cpp.
References iot::mqtt::Mqtt::connectionName, iot::mqtt::MqttContext::end(), iot::mqtt::packets::Suback::getPacketIdentifier(), iot::mqtt::packets::Suback::getReturnCodes(), iot::mqtt::Mqtt::mqttContext, and onSuback().
Referenced by iot::mqtt::client::packets::Suback::deliverPacket().
|
private |
Definition at line 246 of file Mqtt.cpp.
References iot::mqtt::Mqtt::connectionName, iot::mqtt::MqttContext::end(), iot::mqtt::packets::Unsuback::getPacketIdentifier(), iot::mqtt::Mqtt::mqttContext, and onUnsuback().
Referenced by iot::mqtt::client::packets::Unsuback::deliverPacket().
|
finalprivatevirtual |
Implements iot::mqtt::Mqtt.
Definition at line 135 of file Mqtt.cpp.
References iot::mqtt::client::packets::Connack::Connack(), iot::mqtt::FixedHeader::getFlags(), iot::mqtt::FixedHeader::getRemainingLength(), iot::mqtt::FixedHeader::getType(), iot::mqtt::client::packets::Pingresp::Pingresp(), iot::mqtt::client::packets::Puback::Puback(), iot::mqtt::client::packets::Pubcomp::Pubcomp(), iot::mqtt::client::packets::Publish::Publish(), iot::mqtt::client::packets::Pubrec::Pubrec(), iot::mqtt::client::packets::Pubrel::Pubrel(), iot::mqtt::client::packets::Suback::Suback(), and iot::mqtt::client::packets::Unsuback::Unsuback().
|
overrideprivatevirtual |
Implements iot::mqtt::Mqtt.
Definition at line 174 of file Mqtt.cpp.
References iot::mqtt::client::ControlPacketDeserializer::deliverPacket().
|
privatevirtual |
Definition at line 182 of file Mqtt.cpp.
Referenced by _onConnack().
|
privatevirtual |
Definition at line 191 of file Mqtt.cpp.
Referenced by _onPingresp().
|
overrideprotectedvirtual |
|
privatevirtual |
Definition at line 185 of file Mqtt.cpp.
Referenced by _onSuback().
|
privatevirtual |
Definition at line 188 of file Mqtt.cpp.
Referenced by _onUnsuback().
| void iot::mqtt::client::Mqtt::sendConnect | ( | bool | cleanSession, |
| const std::string & | willTopic, | ||
| const std::string & | willMessage, | ||
| uint8_t | willQoS, | ||
| bool | willRetain, | ||
| const std::string & | username, | ||
| const std::string & | password, | ||
| bool | loopPrevention = false |
||
| ) | const |
Definition at line 262 of file Mqtt.cpp.
References iot::mqtt::Mqtt::clientId, iot::mqtt::packets::Connect::Connect(), iot::mqtt::Mqtt::connectionName, keepAlive, and iot::mqtt::Mqtt::send().
| void iot::mqtt::client::Mqtt::sendDisconnect | ( | ) | const |
Definition at line 292 of file Mqtt.cpp.
References iot::mqtt::packets::Disconnect::Disconnect(), iot::mqtt::MqttContext::end(), iot::mqtt::Mqtt::mqttContext, and iot::mqtt::Mqtt::send().
| void iot::mqtt::client::Mqtt::sendPingreq | ( | ) | const |
Definition at line 288 of file Mqtt.cpp.
References iot::mqtt::packets::Pingreq::Pingreq(), and iot::mqtt::Mqtt::send().
Referenced by _onConnack().
| void iot::mqtt::client::Mqtt::sendSubscribe | ( | const std::list< Topic > & | topics | ) | const |
Definition at line 276 of file Mqtt.cpp.
References iot::mqtt::Mqtt::getPacketIdentifier(), iot::mqtt::Mqtt::send(), and iot::mqtt::packets::Subscribe::Subscribe().
| void iot::mqtt::client::Mqtt::sendUnsubscribe | ( | const std::list< std::string > & | topics | ) | const |
Definition at line 282 of file Mqtt.cpp.
References iot::mqtt::Mqtt::getPacketIdentifier(), iot::mqtt::Mqtt::send(), and iot::mqtt::packets::Unsubscribe::Unsubscribe().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
Definition at line 139 of file Mqtt.h.
Referenced by _onConnack(), Mqtt(), and sendConnect().
|
private |
Definition at line 145 of file Mqtt.h.
Referenced by _onConnack(), and ~Mqtt().
|
private |
Definition at line 143 of file Mqtt.h.
Referenced by _onConnack(), Mqtt(), and ~Mqtt().
|
private |