Zigbee Protocol Controller 1.6.0
zigpc_ucl_int.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
13
23#ifndef ZIGPC_UCL_INT_HPP
24#define ZIGPC_UCL_INT_HPP
25
26#include <nlohmann/json.hpp>
27
28// Unify shared includes
29#include <sl_status.h>
30#include <uic_mqtt.h>
31
32// ZigPC includes
33#include <zigpc_common_zigbee.h>
34#include <zigpc_net_mgmt.h>
36
37// Component includes
38#include "zigpc_ucl.hpp"
39
44namespace zigpc_ucl
45{
46constexpr char LOG_TAG[] = "zigpc_ucl";
47constexpr char LOG_FMT_JSON_ERROR[] = "%s: Unable to parse JSON payload: %s";
48
54namespace mqtt
55{
64sl_status_t parse_payload(const char *payload, nlohmann::json &jsn);
65
78
92 const char *payload,
93 size_t payload_size,
94 bool retain);
95
107
108} // namespace mqtt
109
116namespace pc_nwmgmt
117{
127
137void on_write_mqtt(const char *topic,
138 const char *message,
139 const size_t message_length);
140
150
151} // namespace pc_nwmgmt
152
153} // namespace zigpc_ucl
154
155#endif /* ZIGPC_UCL_INT_HPP */
156
void(* mqtt_message_callback_t)(const char *topic, const char *message, const size_t message_length)
A callback type for pushing incoming messages.
Definition: uic_mqtt.h:60
uint32_t sl_status_t
Definition: sl_status.h:139
uint64_t zigbee_eui64_uint_t
Zigbee Device Identifier (stored as integer)
Definition: zigpc_common_zigbee.h:199
topic_type_t
Types of specific UCL topics that can be build along with variables passed via mqtt::topic_data_t.
Definition: zigpc_ucl.hpp:65
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.
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.
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.
sl_status_t parse_payload(const char *payload, nlohmann::json &jsn)
Parse the Incoming JSON payload into the passed in property tree.
sl_status_t on_net_init(zigbee_eui64_uint_t pc_eui64)
Event handler when the network has initialized. This handler will initialized any MQTT subscriptions ...
void on_write_mqtt(const char *topic, const char *message, const size_t message_length)
MQTT subscription handler for receiving network management updates. This function will send a dynamic...
sl_status_t on_net_state_update(zigpc_net_mgmt_on_network_state_update_t &state)
Event handler when the network state has been updated. This handler will update the NetworkManagement...
UCL topic and payload manipulators in the Zigbee Protocol Controller.
Definition: zigpc_ucl.hpp:52
constexpr char LOG_FMT_JSON_ERROR[]
Definition: zigpc_ucl_int.hpp:47
constexpr char LOG_TAG[]
Definition: zigpc_ucl_int.hpp:46
SL Status Codes.
Event data on network state update. These fields will be used to publish the new state as well as any...
Definition: zigpc_net_mgmt_notify.h:68
Data that is used to build UCL topics.
Definition: zigpc_ucl.hpp:77