SNode.C
Loading...
Searching...
No Matches
iot::mqtt::packets::Connack Class Reference

#include <Connack.h>

Inheritance diagram for iot::mqtt::packets::Connack:
Collaboration diagram for iot::mqtt::packets::Connack:

Public Member Functions

 Connack ()
 Connack (uint8_t returncode, uint8_t acknowledgeFlags)
uint8_t getAcknowledgeFlags () const
uint8_t getReturnCode () const
bool getSessionPresent () const
Public Member Functions inherited from iot::mqtt::ControlPacket
 ControlPacket (uint8_t type, const std::string &name)
 ControlPacket (const ControlPacket &)=default
 ControlPacket (ControlPacket &&)=default
virtual ~ControlPacket ()
ControlPacketoperator= (const ControlPacket &)=default
ControlPacketoperator= (ControlPacket &&)=default
std::vector< char > serialize () const
const std::string & getName () const

Protected Attributes

iot::mqtt::types::UInt8 acknowledgeFlags
iot::mqtt::types::UInt8 returnCode
bool sessionPresent = false
Protected Attributes inherited from iot::mqtt::ControlPacket
uint8_t flags = 0

Private Member Functions

std::vector< char > serializeVP () const override

Additional Inherited Members

Protected Member Functions inherited from iot::mqtt::ControlPacket
uint8_t getType () const
uint8_t getFlags () const

Detailed Description

Definition at line 66 of file Connack.h.

Constructor & Destructor Documentation

◆ Connack() [1/2]

iot::mqtt::packets::Connack::Connack ( )

Definition at line 53 of file Connack.cpp.

54 : iot::mqtt::ControlPacket(MQTT_CONNACK, "CONNACK") {
55 }
#define MQTT_CONNACK
Definition Connack.h:57

References iot::mqtt::ControlPacket::ControlPacket().

Referenced by Connack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Connack() [2/2]

iot::mqtt::packets::Connack::Connack ( uint8_t returncode,
uint8_t acknowledgeFlags )

Definition at line 57 of file Connack.cpp.

58 : Connack() {
59 this->returnCode = returncode;
61 }
iot::mqtt::types::UInt8 acknowledgeFlags
Definition Connack.h:81
iot::mqtt::types::UInt8 returnCode
Definition Connack.h:82

References acknowledgeFlags, Connack(), iot::mqtt::types::UInt8::operator=(), and returnCode.

Referenced by iot::mqtt::server::Mqtt::sendConnack().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ getAcknowledgeFlags()

uint8_t iot::mqtt::packets::Connack::getAcknowledgeFlags ( ) const

Definition at line 72 of file Connack.cpp.

72 {
73 return acknowledgeFlags;
74 }

References acknowledgeFlags.

Referenced by iot::mqtt::client::Mqtt::_onConnack().

Here is the caller graph for this function:

◆ getReturnCode()

uint8_t iot::mqtt::packets::Connack::getReturnCode ( ) const

Definition at line 76 of file Connack.cpp.

76 {
77 return returnCode;
78 }

References returnCode.

Referenced by iot::mqtt::client::Mqtt::_onConnack().

Here is the caller graph for this function:

◆ getSessionPresent()

bool iot::mqtt::packets::Connack::getSessionPresent ( ) const

Definition at line 80 of file Connack.cpp.

80 {
81 return sessionPresent;
82 }

References sessionPresent.

Referenced by iot::mqtt::client::Mqtt::_onConnack().

Here is the caller graph for this function:

◆ serializeVP()

std::vector< char > iot::mqtt::packets::Connack::serializeVP ( ) const
overrideprivatevirtual

Implements iot::mqtt::ControlPacket.

Definition at line 63 of file Connack.cpp.

63 {
64 std::vector<char> packet(acknowledgeFlags.serialize());
65
66 std::vector<char> tmpVector = returnCode.serialize();
67 packet.insert(packet.end(), tmpVector.begin(), tmpVector.end());
68
69 return packet;
70 }

References acknowledgeFlags, returnCode, and iot::mqtt::types::TypeBase< ValueTypeT >::serialize().

Here is the call graph for this function:

Member Data Documentation

◆ acknowledgeFlags

iot::mqtt::types::UInt8 iot::mqtt::packets::Connack::acknowledgeFlags
protected

◆ returnCode

iot::mqtt::types::UInt8 iot::mqtt::packets::Connack::returnCode
protected

◆ sessionPresent

bool iot::mqtt::packets::Connack::sessionPresent = false
protected

The documentation for this class was generated from the following files: