Zigbee Protocol Controller 1.6.0
|
UCL utility functions available to build and parse MQTT topics and payloads. More...
Classes | |
struct | topic_data_t |
Data that is used to build UCL topics. More... | |
Enumerations | |
enum class | topic_type_t { BY_UNID_PC_NWMGMT , BY_UNID_PC_NWMGMT_WRITE , BY_UNID_NODE_STATE , BY_UNID_NODE , BY_UNID_NODE_EP } |
Types of specific UCL topics that can be build along with variables passed via mqtt::topic_data_t. More... | |
Functions | |
sl_status_t | build_topic (zigpc_ucl::mqtt::topic_type_t topic_type, zigpc_ucl::mqtt::topic_data_t topic_data, std::string &topic) |
Populate the topic string based on the topic type and data passed in. More... | |
sl_status_t | parse_unid (std::string unid, zigbee_eui64_uint_t &eui64) |
Parse a UCL UNID into Zigbee device identifier. More... | |
sl_status_t | parse_endpoint (std::string endpoint_str, zigbee_endpoint_id_t &endpoint) |
sl_status_t | parse_topic_eui64 (const std::string topic, zigbee_eui64_uint_t &eui64) |
sl_status_t | parse_topic_endpoint (const std::string topic, zigbee_endpoint_id_t &endpoint) |
sl_status_t | parse_topic_cluster (const std::string topic, std::string &cluster_name) |
sl_status_t | parse_binding (const std::string topic, const std::string payload, zigbee_eui64_uint_t &source_eui64, zigbee_endpoint_id_t &source_ep, std::string &cluster_name, zigbee_eui64_uint_t &dest_eui64, zigbee_endpoint_id_t &dest_ep) |
std::string | build_unid (zigbee_eui64_uint_t eui64) |
Build a UCL UNID based on the Zigbee device identifier. More... | |
sl_status_t | publish_supported_generated (zigbee_eui64_uint_t eui64, zigbee_endpoint_id_t endpoint_id) |
sl_status_t | parse_payload (const char *payload, nlohmann::json &jsn) |
Parse the Incoming JSON payload into the passed in property tree. More... | |
sl_status_t | subscribe (zigpc_ucl::mqtt::topic_type_t topic_type, zigpc_ucl::mqtt::topic_data_t topic_data, mqtt_message_callback_t cb) |
Subscribe to a UCL topic based on the type and data passed in. More... | |
sl_status_t | publish (zigpc_ucl::mqtt::topic_type_t topic_type, zigpc_ucl::mqtt::topic_data_t topic_data, const char *payload, size_t payload_size, bool retain) |
Publish payload to a UCL topic based on the type and data passed in. More... | |
sl_status_t | unretain (zigpc_ucl::mqtt::topic_type_t topic_type, zigpc_ucl::mqtt::topic_data_t topic_data) |
Unretain a UCL topic based on the specific topic type and topic variables passed in. More... | |
UCL utility functions available to build and parse MQTT topics and payloads.
|
strong |
Types of specific UCL topics that can be build along with variables passed via mqtt::topic_data_t.
Enumerator | |
---|---|
BY_UNID_PC_NWMGMT | Uses topic_data_t fields: eui64 |
BY_UNID_PC_NWMGMT_WRITE | Uses topic_data_t fields: eui64 |
BY_UNID_NODE_STATE | Uses topic_data_t fields: eui64 |
BY_UNID_NODE | Uses topic_data_t fields: eui64 |
BY_UNID_NODE_EP | Uses topic_data_t fields: eui64, endpoint_id |
sl_status_t zigpc_ucl::mqtt::build_topic | ( | zigpc_ucl::mqtt::topic_type_t | topic_type, |
zigpc_ucl::mqtt::topic_data_t | topic_data, | ||
std::string & | topic | ||
) |
Populate the topic string based on the topic type and data passed in.
topic_type | Topic type. |
topic_data | Data to populate in the topic. |
topic | Topic to populate. |
std::string zigpc_ucl::mqtt::build_unid | ( | zigbee_eui64_uint_t | eui64 | ) |
Build a UCL UNID based on the Zigbee device identifier.
eui64 | Zigbee identifier reference to convert. |
sl_status_t zigpc_ucl::mqtt::parse_binding | ( | const std::string | topic, |
const std::string | payload, | ||
zigbee_eui64_uint_t & | source_eui64, | ||
zigbee_endpoint_id_t & | source_ep, | ||
std::string & | cluster_name, | ||
zigbee_eui64_uint_t & | dest_eui64, | ||
zigbee_endpoint_id_t & | dest_ep | ||
) |
sl_status_t zigpc_ucl::mqtt::parse_endpoint | ( | std::string | endpoint_str, |
zigbee_endpoint_id_t & | endpoint | ||
) |
sl_status_t zigpc_ucl::mqtt::parse_payload | ( | const char * | payload, |
nlohmann::json & | jsn | ||
) |
Parse the Incoming JSON payload into the passed in property tree.
payload | Incoming character array of payload. |
jsn | Json object to populate payload to. |
sl_status_t zigpc_ucl::mqtt::parse_topic_cluster | ( | const std::string | topic, |
std::string & | cluster_name | ||
) |
sl_status_t zigpc_ucl::mqtt::parse_topic_endpoint | ( | const std::string | topic, |
zigbee_endpoint_id_t & | endpoint | ||
) |
sl_status_t zigpc_ucl::mqtt::parse_topic_eui64 | ( | const std::string | topic, |
zigbee_eui64_uint_t & | eui64 | ||
) |
sl_status_t zigpc_ucl::mqtt::parse_unid | ( | std::string | unid, |
zigbee_eui64_uint_t & | eui64 | ||
) |
Parse a UCL UNID into Zigbee device identifier.
unid | UNID string to parse. |
eui64 | Zigbee identifier reference to poulate. |
sl_status_t zigpc_ucl::mqtt::publish | ( | zigpc_ucl::mqtt::topic_type_t | topic_type, |
zigpc_ucl::mqtt::topic_data_t | topic_data, | ||
const char * | payload, | ||
size_t | payload_size, | ||
bool | retain | ||
) |
Publish payload to a UCL topic based on the type and data passed in.
topic_type | UCL topic type. |
topic_data | Data to be populated in topic. |
payload | Payload to publish. |
payload_size | Size of payload to publish. |
retain | Publish the payload as retained or not. |
sl_status_t zigpc_ucl::mqtt::publish_supported_generated | ( | zigbee_eui64_uint_t | eui64, |
zigbee_endpoint_id_t | endpoint_id | ||
) |
sl_status_t zigpc_ucl::mqtt::subscribe | ( | zigpc_ucl::mqtt::topic_type_t | topic_type, |
zigpc_ucl::mqtt::topic_data_t | topic_data, | ||
mqtt_message_callback_t | cb | ||
) |
Subscribe to a UCL topic based on the type and data passed in.
topic_type | UCL topic type. |
topic_data | Data to be populated in topic. |
cb | Callback to invoke on messages to the topic. |
sl_status_t zigpc_ucl::mqtt::unretain | ( | zigpc_ucl::mqtt::topic_type_t | topic_type, |
zigpc_ucl::mqtt::topic_data_t | topic_data | ||
) |
Unretain a UCL topic based on the specific topic type and topic variables passed in.
topic_type | Specific UCL topic type. |
topic_data | Variables used to populate specific UCL topic type. |