Zigbee Protocol Controller 1.6.0
dotdot_mqtt_parsing_helpers.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2022 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 DOTDOT_MQTT_PARSING_HELPERS_HPP
24#define DOTDOT_MQTT_PARSING_HELPERS_HPP
25
26#include "sl_status.h"
27#include "uic_typedefs.h"
28
29#include "dotdot_bitmap.hpp"
30
31#include <string>
32#include <map>
33
35{
44bool parse_topic_no_endpoint(const std::string &topic, std::string &unid);
45
55bool parse_topic(const std::string &topic,
56 std::string &unid,
57 dotdot_endpoint_id_t &endpoint);
58
67bool parse_topic_group_id(const std::string &&topic,
68 dotdot_group_id_t &group_id);
69
81sl_status_t get_topic_last_item(const std::string &topic,
82 std::string &last_item);
83
89std::map<std::string, bool>
91
101 nlohmann::json &jsn,
102 dotdot_bitmap bitmap_handler);
103
113 nlohmann::json &jsn,
114 dotdot_bitmap bitmap_handler);
115
116} // namespace uic_dotdot_mqtt
117
118#endif //DOTDOT_MQTT_PARSING_HELPERS_HPP
Definition: dotdot_bitmap.hpp:34
A class representation of a bitmap.
uint32_t sl_status_t
Definition: sl_status.h:139
Definition: dotdot_mqtt_parsing_helpers.hpp:35
std::map< std::string, bool > get_bitmap_value_names(uint32_t value, dotdot_bitmap bitmap_handler)
Finds the list of fields that are set to true/false for a bitmap.
bool parse_topic_no_endpoint(const std::string &topic, std::string &unid)
Helper function to extract unid from a topic string.
uint32_t get_bitmap_decimal_value(std::string key, nlohmann::json &jsn, dotdot_bitmap bitmap_handler)
Get the bitmap decimal value object.
sl_status_t get_topic_last_item(const std::string &topic, std::string &last_item)
Helper function to extract the last item of an MQTT topic.
uint32_t get_bitmap_decimal_value_from_array(size_t index, nlohmann::json &jsn, dotdot_bitmap bitmap_handler)
Get the bitmap decimal value from array object.
bool parse_topic_group_id(const std::string &&topic, dotdot_group_id_t &group_id)
Helper function to extract group ID from a topic string.
bool parse_topic(const std::string &topic, std::string &unid, dotdot_endpoint_id_t &endpoint)
Helper function to extract unid and endpoint from a topic string.
SL Status Codes.
Generic type definitions for Unify.
uint16_t dotdot_group_id_t
Definition: uic_typedefs.h:41
uint8_t dotdot_endpoint_id_t
Definition: uic_typedefs.h:38