AWS IoT C++ SDK
Loading...
Searching...
No Matches
Public Member Functions
awsiotsdk::mqtt::PacketFixedHeader Class Reference

Define a class for the MQTT Fixed header.

#include <Packet.hpp>

Public Member Functions

 PacketFixedHeader ()
 Constructor. More...
 
ResponseCode Initialize (MessageTypes message_type, bool is_duplicate, QoS qos, bool is_retained, size_t rem_len)
 Initialize the fixed header with provided values. Checks for validity. More...
 
bool isHeaderValid ()
 Is this a valid fixed header? More...
 
MessageTypes GetMessageType ()
 Get message type. More...
 
size_t GetRemainingLength ()
 Get remaining length. More...
 
size_t GetRemainingLengthByteCount ()
 Get number of bytes required to store remaining length. More...
 
size_t Length ()
 Get length of the fixed header. More...
 
void AppendToBuffer (util::String &p_buf)
 Append this header to a string. More...
 

Constructor & Destructor Documentation

◆ PacketFixedHeader()

awsiotsdk::mqtt::PacketFixedHeader::PacketFixedHeader ( )
Returns
Initializes the fixed header with default values, sets is_valid_ to false

Member Function Documentation

◆ AppendToBuffer()

void awsiotsdk::mqtt::PacketFixedHeader::AppendToBuffer ( util::String &  p_buf)
Parameters
p_bufReference to target string

◆ GetMessageType()

MessageTypes awsiotsdk::mqtt::PacketFixedHeader::GetMessageType ( )
Returns
Message type

◆ GetRemainingLength()

size_t awsiotsdk::mqtt::PacketFixedHeader::GetRemainingLength ( )
inline
Returns
Remaining length

◆ GetRemainingLengthByteCount()

size_t awsiotsdk::mqtt::PacketFixedHeader::GetRemainingLengthByteCount ( )
Returns
Number of butes required to store remaining length

◆ Initialize()

ResponseCode awsiotsdk::mqtt::PacketFixedHeader::Initialize ( MessageTypes  message_type,
bool  is_duplicate,
QoS  qos,
bool  is_retained,
size_t  rem_len 
)
Parameters
message_typeMQTT message type
is_duplicateIs this a duplicate message (For publish messages)
qosQoS to use for this message (For publish messages)
is_retainedMQTT is retained flag (For publish messages)
rem_lenRemaining length
Returns
ResponseCode indicating status of request

◆ isHeaderValid()

bool awsiotsdk::mqtt::PacketFixedHeader::isHeaderValid ( )
Returns
boolean indicating validity

◆ Length()

size_t awsiotsdk::mqtt::PacketFixedHeader::Length ( )
inline
Returns
Length