16#include <nlohmann/json.hpp>
23 static constexpr char LOG_TAG[] =
"diagnostics_metric_counters";
34 uint16_t counter_array[capacity];
47 for (uint8_t i = 0U; i < capacity; i++) {
49 if (label_cstr ==
nullptr) {
53 jsn[std::string(label_cstr)] = counter_array[i];
Definition: zigpc_counter_plugin_metric.hpp:21
static constexpr char LOG_TAG[]
Definition: zigpc_counter_plugin_metric.hpp:23
void update_value()
Definition: zigpc_counter_plugin_metric.hpp:31
zigpc_counter_plugin_metric(zigpc_diagnostics_notification ¬if, std::string metric_id)
Definition: zigpc_counter_plugin_metric.hpp:26
Abstract top level metric from which all diagnostic metric derive from.
Definition: zigpc_diagnostics_metric.hpp:25
zigpc_diagnostics_notification & on_update_complete
Definition: zigpc_diagnostics_metric.hpp:28
std::string serialized_value
Definition: zigpc_diagnostics_metric.hpp:30
std::string metric_id
Definition: zigpc_diagnostics_metric.hpp:29
Definition: zigpc_diagnostics_notification.hpp:20
virtual void notify(std::string metric_id)
Definition: zigpc_diagnostics_notification.hpp:22
#define sl_log_error(tag, fmtstr,...)
Definition: sl_log.h:145
#define SL_STATUS_OK
No error.
Definition: sl_status.h:49
size_t zigpc_gateway_get_counters_capacity()
Get the counters capacity.
sl_status_t zigpc_gateway_get_counters_list(uint16_t *list, size_t count)
Populate counters values to list provided.
const char * zigpc_gateway_get_counters_entry_label(size_t offset)
Get the label of the counters entry based on the offset passed in.