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

Define a class for Unsuback Packet type. More...

#include <Subscribe.hpp>

Inheritance diagram for awsiotsdk::mqtt::UnsubackPacket:
awsiotsdk::mqtt::Packet awsiotsdk::ActionData

Public Member Functions

 UnsubackPacket (const UnsubackPacket &)=delete
 
 UnsubackPacket (UnsubackPacket &&)=delete
 
UnsubackPacketoperator= (const UnsubackPacket &) &=delete
 
UnsubackPacketoperator= (UnsubackPacket &&) &=delete
 
 UnsubackPacket (const util::Vector< unsigned char > &buf)
 Constructor. More...
 
util::String ToString ()
 Serialize this packet into a String. More...
 
- Public Member Functions inherited from awsiotsdk::mqtt::Packet
 Packet (const Packet &)=delete
 
 Packet (Packet &&)=delete
 
Packetoperator= (const Packet &) &=delete
 
Packetoperator= (Packet &&) &=delete
 
uint16_t GetActionId ()
 Get ID of the current run of this Action. More...
 
void SetActionId (uint16_t action_id)
 Set the Action ID for this run of the Action. More...
 
bool isPacketDataValid ()
 
uint16_t GetPacketId ()
 
void SetPacketId (uint16_t packet_id)
 
size_t Size ()
 
virtual util::String ToString ()=0
 
- Public Member Functions inherited from awsiotsdk::ActionData
 ActionData (const ActionData &)=default
 
 ActionData (ActionData &&)=default
 
ActionDataoperator= (const ActionData &) &=default
 
ActionDataoperator= (ActionData &&) &=default
 
virtual uint16_t GetActionId ()=0
 Get ID of the current run of this Action. More...
 
virtual void SetActionId (uint16_t action_id)=0
 Set the Action ID for this run of the Action. More...
 

Static Public Member Functions

static std::shared_ptr< UnsubackPacketCreate (const util::Vector< unsigned char > &buf)
 Factory Create method. More...
 
- Static Public Member Functions inherited from awsiotsdk::mqtt::Packet
static void AppendUInt16ToBuffer (util::String &buf, uint16_t value)
 
static void AppendUtf8StringToBuffer (util::String &buf, std::unique_ptr< Utf8String > &utf8_str)
 
static void AppendUtf8StringToBuffer (util::String &buf, std::shared_ptr< Utf8String > &utf8_str)
 
static uint16_t ReadUInt16FromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index)
 
static std::unique_ptr< Utf8StringReadUtf8StringFromBuffer (const util::Vector< unsigned char > &buf, size_t &extract_index)
 

Additional Inherited Members

- Public Types inherited from awsiotsdk::ActionData
typedef std::function< void(uint16_t action_id, ResponseCode rc)> AsyncAckNotificationHandlerPtr
 
- Data Fields inherited from awsiotsdk::ActionData
AsyncAckNotificationHandlerPtr p_async_ack_handler_
 Handler to call when response is received for this action.
 
- Protected Attributes inherited from awsiotsdk::mqtt::Packet
PacketFixedHeader fixed_header_
 Fixed header for this packet instance.
 
size_t packet_size_
 Size of the packet.
 
size_t serialized_packet_length_
 Serialized length of the entire packet including fixed header.
 
std::atomic_uint_fast16_t packet_id_
 Message sequence identifier. Handled automatically by the MQTT client.
 

Detailed Description

This class defines the Packet type used in MQTT to Acknowledge Unsubscribe requests

Constructor & Destructor Documentation

◆ UnsubackPacket()

awsiotsdk::mqtt::UnsubackPacket::UnsubackPacket ( const util::Vector< unsigned char > &  buf)
Warning
This constructor can throw exceptions, it is recommended to use Factory create method Constructor is kept public to not restrict usage possibilities (eg. make_shared)
Parameters
bufSerialized version of the packet to parse

Member Function Documentation

◆ Create()

std::shared_ptr< UnsubackPacket > awsiotsdk::mqtt::UnsubackPacket::Create ( const util::Vector< unsigned char > &  buf)
static
Parameters
bufSerialized version of the packet to parse
Returns
nullptr on error, shared_ptr pointing to a created UnsubackPacket instance if successful

◆ ToString()

util::String awsiotsdk::mqtt::UnsubackPacket::ToString ( )
virtual
Returns
String containing serialized packet

Implements awsiotsdk::mqtt::Packet.