MQTT Subscription Definition.
More...
#include <Common.hpp>
|
bool | is_active_ |
| Boolean indicating weather the subscription is active or not.
|
|
uint16_t | packet_id_ |
| Packet Id of the Subscribe/Unsubscribe Packet.
|
|
uint8_t | index_in_packet_ |
| Index of the subscription in the Subscribe/Unsubscribe Packet.
|
|
QoS | max_qos_ |
| Max QoS for messages on this subscription.
|
|
std::shared_ptr< Utf8String > | p_topic_name_ |
| Topic Name for this subscription.
|
|
Defining a type for the MQTT Subscriptions Contains all information required to process a subscription including callback handler
- Note
- Also defines a type for the Application callback handler - Subscription::ApplicationCallbackHandlerPtr
◆ ApplicationCallbackHandlerPtr
This handler is used to provide notification to the application when a message is received on a subscribed topic
◆ Subscription()
- Parameters
-
p_topic_name | - Topic name for this subscription |
max_qos | - Max QoS |
p_app_handler | - Application Handler instance |
p_app_handler_data | - Data to be passed to application handler. Can be nullptr |
◆ Create()
- Parameters
-
p_topic_name | - Topic name for this subscription |
max_qos | - Max QoS |
p_app_handler | - Application Handler instance |
p_app_handler_data | - Data to be passed to application handler. Can be nullptr |
- Returns
- shared_ptr Subscription instance
◆ GetMaxQos()
QoS awsiotsdk::mqtt::Subscription::GetMaxQos |
( |
| ) |
|
|
inline |
◆ GetPacketId()
uint16_t awsiotsdk::mqtt::Subscription::GetPacketId |
( |
| ) |
|
|
inline |
- Returns
- uint16_t ID of the packet
◆ GetTopicName()
std::shared_ptr< Utf8String > awsiotsdk::mqtt::Subscription::GetTopicName |
( |
| ) |
|
|
inline |
- Returns
- shared_ptr to a Utf8String containing topic name
◆ GetTopicNameLength()
size_t awsiotsdk::mqtt::Subscription::GetTopicNameLength |
( |
| ) |
|
|
inline |
◆ IsActive()
bool awsiotsdk::mqtt::Subscription::IsActive |
( |
| ) |
|
|
inline |
- Returns
- boolean indicating whether the subscription is active
◆ IsInSuback()
bool awsiotsdk::mqtt::Subscription::IsInSuback |
( |
uint16_t |
packet_id, |
|
|
uint8_t |
index_in_packet |
|
) |
| |
|
inline |
- Parameters
-
packet_id | - Packet ID of received SUBACK |
index_in_packet | - Index in SUBACK |
- Returns
- boolean indicating whether this Subscription was the target for the received SUBACK
◆ IsValidTopicName()
bool awsiotsdk::mqtt::Subscription::IsValidTopicName |
( |
util::String |
p_topic_name | ) |
|
|
static |
- Returns
- boolean indicating whether the topic is a valid topic
◆ SetAckIndex()
void awsiotsdk::mqtt::Subscription::SetAckIndex |
( |
uint16_t |
packet_id, |
|
|
uint8_t |
index_in_packet |
|
) |
| |
|
inline |
- Parameters
-
packet_id | - Expected packet id |
index_in_packet | - Expected Index in packet |
◆ SetActive()
void awsiotsdk::mqtt::Subscription::SetActive |
( |
bool |
value | ) |
|
|
inline |
- Parameters
-
value | - boolean value indicating target status |
◆ SetMaxQos()
void awsiotsdk::mqtt::Subscription::SetMaxQos |
( |
mqtt::QoS |
max_qos | ) |
|
|
inline |