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

Last Will and Testament Definition. More...

#include <Common.hpp>

Public Member Functions

 WillOptions (bool is_retained, QoS qos, std::unique_ptr< Utf8String > p_topic_name, util::String &message)
 Constructor. More...
 
 WillOptions (WillOptions &&)=default
 
WillOptionsoperator= (WillOptions &&) &=default
 
 WillOptions (const WillOptions &source)
 
WillOptionsoperator= (const WillOptions &source) &
 
size_t Length ()
 Get length of Will Options message. More...
 
void WriteToBuffer (util::String &buf)
 Serialize and write Will Options to provided buffer. More...
 
void SetConnectFlags (unsigned char &p_flag)
 Set Connect flags in the provided buffer based on Will Options instance. More...
 

Static Public Member Functions

static std::unique_ptr< WillOptionsCreate (bool is_retained, QoS qos, std::unique_ptr< Utf8String > p_topic_name, util::String &message)
 Factory method to Create a Will Options instance. More...
 

Detailed Description

Defining a type for the MQTT "Last Will and Testament" (LWT) parameters.

Note
Retained messages are NOT supported by the AWS IoT Service at the time of this SDK release.

Constructor & Destructor Documentation

◆ WillOptions()

awsiotsdk::mqtt::WillOptions::WillOptions ( bool  is_retained,
QoS  qos,
std::unique_ptr< Utf8String p_topic_name,
util::String &  message 
)
Parameters
is_retained- MQTT Is Retained flag
qos- QoS for the Will Message
p_topic_name- Topic name on which to publish the will message
p_message- Payload of the message to publish

Member Function Documentation

◆ Create()

std::unique_ptr< WillOptions > awsiotsdk::mqtt::WillOptions::Create ( bool  is_retained,
QoS  qos,
std::unique_ptr< Utf8String p_topic_name,
util::String &  message 
)
static
Parameters
is_retained- MQTT Is Retained flag
qos- QoS for the Will Message
p_topic_name- Topic name on which to publish the will message
p_message- Payload of the message to publish
Returns
Returns a unique pointer to a WillOptions Instance

◆ Length()

size_t awsiotsdk::mqtt::WillOptions::Length ( )
Returns
size_t Length

◆ SetConnectFlags()

void awsiotsdk::mqtt::WillOptions::SetConnectFlags ( unsigned char &  p_flag)
Parameters
p_flagTarget buffer

◆ WriteToBuffer()

void awsiotsdk::mqtt::WillOptions::WriteToBuffer ( util::String &  buf)
Parameters
buf- Reference to target buffer