Zigbee Protocol Controller 1.6.0
zigpc_diagnostics_mqtt_helper.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
14/*
15HOW-TO and class relationship of diagnostic manager :
16The goal of this component is to receive and send diagnosis information via mqtt
17
18This component is composed of three parts, the manager, the metrics and a mqtt helper.
19
20The manager :
21 -Contains all the metric in a map
22 -Receives request as a string of metric array from mqtt_helper
23 -Ask the relevant metrics to update their values and notify back the manager
24 -Publishes the resulting information under the correct unid and topic
25
26The Metric :
27 - Are derived from the base metric classes
28 - Get relevant information and then notify the manager that the info is ready
29
30The MQTT Helper
31 -Contains the process which handles request
32 -Initialises the whole component on a network init event
33 -Is used to add all metrics in the map in the initialisation
34 -Subscribes to the correct request topic
35
36
37*/
38#ifndef ZIGPC_DIAGNOSTICS_MQTT_HELPER
39#define ZIGPC_DIAGNOSTICS_MQTT_HELPER
40
41#include "zigpc_diagnostics.h"
42#include <string>
43
44#include <vector>
45
46static const std::string ZIGPC_DIAGNOSTIC_TOPIC =
47 "/ProtocolController/SystemHealth/";
48
49void uic_diagnostics_mqtt_callback(const char *topic,
50 const char *payload,
51 size_t payload_size);
52
54
56
57std::vector<std::string>
58 uic_diagnostic_request_to_strings(std::string *payload_string);
59
60#endif
uint32_t sl_status_t
Definition: sl_status.h:139
static const std::string ZIGPC_DIAGNOSTIC_TOPIC
Definition: zigpc_diagnostics_mqtt_helper.hpp:46
void uic_diagnostics_mqtt_callback(const char *topic, const char *payload, size_t payload_size)
sl_status_t uic_diagnostics_setup(std::string unid)
void uic_metric_init()
std::vector< std::string > uic_diagnostic_request_to_strings(std::string *payload_string)