SNode.C
|
#include <Mqtt.h>
Public Member Functions | |
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 | ~Mqtt () |
virtual void | onConnected () |
virtual void | onDisconnected () |
virtual bool | onSignal (int sig)=0 |
const std::string & | getConnectionName () const |
const MqttContext * | getMqttContext () const |
void | sendPublish (const std::string &topic, const std::string &message, uint8_t qoS, bool retain) |
void | sendPuback (uint16_t packetIdentifier) const |
void | sendPubrec (uint16_t packetIdentifier) const |
void | sendPubrel (uint16_t packetIdentifier) const |
void | sendPubcomp (uint16_t packetIdentifier) const |
Static Public Member Functions | |
static std::string | toHexString (const std::vector< char > &data) |
static std::string | toHexString (const std::string &data) |
Protected Member Functions | |
void | initSession (Session *session, utils::Timeval keepAlive) |
virtual void | onPublish (const iot::mqtt::packets::Publish &publish) |
virtual void | onPuback (const iot::mqtt::packets::Puback &puback) |
virtual void | onPubrec (const iot::mqtt::packets::Pubrec &pubrec) |
virtual void | onPubrel (const iot::mqtt::packets::Pubrel &pubrel) |
virtual void | onPubcomp (const iot::mqtt::packets::Pubcomp &pubcomp) |
bool | _onPublish (const iot::mqtt::packets::Publish &publish) |
void | _onPuback (const iot::mqtt::packets::Puback &puback) |
void | _onPubrec (const iot::mqtt::packets::Pubrec &pubrec) |
void | _onPubrel (const iot::mqtt::packets::Pubrel &pubrel) |
void | _onPubcomp (const iot::mqtt::packets::Pubcomp &pubcomp) |
uint16_t | getPacketIdentifier () |
void | send (const iot::mqtt::ControlPacket &controlPacket) const |
void | printVP (const iot::mqtt::ControlPacket &packet) const |
void | printFixedHeader (const iot::mqtt::FixedHeader &fixedHeader) const |
Protected Attributes | |
std::string | connectionName |
std::string | clientId |
MqttContext * | mqttContext = nullptr |
Private Member Functions | |
std::size_t | onReceivedFromPeer () |
void | setMqttContext (MqttContext *mqttContext) |
virtual iot::mqtt::ControlPacketDeserializer * | createControlPacketDeserializer (iot::mqtt::FixedHeader &staticHeader)=0 |
virtual void | deliverPacket (iot::mqtt::ControlPacketDeserializer *controlPacketDeserializer)=0 |
void | send (const std::vector< char > &data) const |
Private Attributes | |
iot::mqtt::FixedHeader | fixedHeader |
iot::mqtt::ControlPacketDeserializer * | controlPacketDeserializer = nullptr |
uint16_t | _packetIdentifier = 0 |
core::timer::Timer | keepAliveTimer |
int | state = 0 |
Session * | session = nullptr |
Friends | |
class | MqttContext |
iot::mqtt::Mqtt::Mqtt | ( | const std::string & | connectionName | ) |
iot::mqtt::Mqtt::Mqtt | ( | const std::string & | connectionName, |
const std::string & | clientId ) |
|
delete |
|
delete |
|
virtual |
Reimplemented in iot::mqtt::client::Mqtt, and iot::mqtt::server::Mqtt.
Definition at line 56 of file Mqtt.cpp.
|
protected |
Definition at line 286 of file Mqtt.cpp.
|
protected |
Definition at line 331 of file Mqtt.cpp.
|
protected |
Definition at line 246 of file Mqtt.cpp.
|
protected |
Definition at line 298 of file Mqtt.cpp.
|
protected |
Definition at line 315 of file Mqtt.cpp.
|
privatepure virtual |
Implemented in iot::mqtt::client::Mqtt, and iot::mqtt::server::Mqtt.
|
privatepure virtual |
Implemented in iot::mqtt::client::Mqtt, and iot::mqtt::server::Mqtt.
const std::string & iot::mqtt::Mqtt::getConnectionName | ( | ) | const |
const MqttContext * iot::mqtt::Mqtt::getMqttContext | ( | ) | const |
|
protected |
|
protected |
Definition at line 152 of file Mqtt.cpp.
|
virtual |
Definition at line 73 of file Mqtt.cpp.
Referenced by iot::mqtt::MqttContext::onConnected().
|
virtual |
Definition at line 144 of file Mqtt.cpp.
Referenced by iot::mqtt::MqttContext::onDisconnected().
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
private |
Definition at line 77 of file Mqtt.cpp.
Referenced by iot::mqtt::MqttContext::onReceivedFromPeer().
|
pure virtual |
Implemented in iot::mqtt::client::Mqtt, and iot::mqtt::server::Mqtt.
Referenced by iot::mqtt::MqttContext::onSignal().
|
protected |
Definition at line 355 of file Mqtt.cpp.
|
protected |
Definition at line 346 of file Mqtt.cpp.
|
protected |
|
private |
void iot::mqtt::Mqtt::sendPuback | ( | uint16_t | packetIdentifier | ) | const |
void iot::mqtt::Mqtt::sendPubcomp | ( | uint16_t | packetIdentifier | ) | const |
void iot::mqtt::Mqtt::sendPublish | ( | const std::string & | topic, |
const std::string & | message, | ||
uint8_t | qoS, | ||
bool | retain ) |
Definition at line 195 of file Mqtt.cpp.
void iot::mqtt::Mqtt::sendPubrec | ( | uint16_t | packetIdentifier | ) | const |
void iot::mqtt::Mqtt::sendPubrel | ( | uint16_t | packetIdentifier | ) | const |
|
private |
Definition at line 65 of file Mqtt.cpp.
Referenced by iot::mqtt::MqttContext::MqttContext().
|
static |
|
static |
Definition at line 367 of file Mqtt.cpp.
|
friend |
|
private |
|
private |
|
private |
|
protected |