Zigbee Protocol Controller 1.6.0
datastore_attributes.h
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
29#ifndef DATASTORE_ATTRIBUTES_H
30#define DATASTORE_ATTRIBUTES_H
31
32#include <inttypes.h>
33#include <stdbool.h>
34#include "sl_status.h"
35
40#define DATASTORE_ATTRIBUTE_VALUE_SIZE 255
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
47
51typedef struct _datastore_attribute_ {
60
87 uint32_t type,
89 const uint8_t *reported_value,
90 uint8_t reported_value_size,
91 const uint8_t *desired_value,
92 uint8_t desired_value_size);
93
123 uint32_t *type,
124 datastore_attribute_id_t *parent_id,
125 uint8_t *reported_value,
126 uint8_t *reported_value_size,
127 uint8_t *desired_value,
128 uint8_t *desired_value_size);
129
147
178 uint32_t child_index,
179 datastore_attribute_id_t *child_id,
180 uint32_t *type,
181 uint8_t *reported_value,
182 uint8_t *reported_value_size,
183 uint8_t *desired_value,
184 uint8_t *desired_value_size);
185
202 uint32_t child_index,
203 datastore_attribute_id_t *child_id);
204
214
225
233
234#ifdef __cplusplus
235}
236#endif
237
238#endif //DATASTORE_ATTRIBUTES_H
sl_status_t datastore_fetch_all_attributes(datastore_attribute_t *attribute)
Fetch all attributes from the datastore.
Definition: datastore_attributes.c:362
sl_status_t datastore_delete_all_attributes()
Delete the whole attribute table in the persistent datastore.
Definition: datastore_attributes.c:552
#define DATASTORE_ATTRIBUTE_VALUE_SIZE
Maximum length that the value (desired or reported) of an attribute can take (in bytes)
Definition: datastore_attributes.h:40
uint32_t datastore_attribute_id_t
Definition: datastore_attributes.h:46
sl_status_t datastore_store_attribute(datastore_attribute_id_t id, uint32_t type, datastore_attribute_id_t parent_id, const uint8_t *reported_value, uint8_t reported_value_size, const uint8_t *desired_value, uint8_t desired_value_size)
Store an attribute in the persistent datastore.
Definition: datastore_attributes.c:228
sl_status_t datastore_delete_attribute(const datastore_attribute_id_t id)
Delete an attribute from the persistent datastore.
Definition: datastore_attributes.c:528
bool datastore_contains_attribute(const datastore_attribute_id_t id)
Check if the datastore contains an attribute for given key.
Definition: datastore_attributes.c:504
sl_status_t datastore_fetch_attribute(const datastore_attribute_id_t id, uint32_t *type, datastore_attribute_id_t *parent_id, uint8_t *reported_value, uint8_t *reported_value_size, uint8_t *desired_value, uint8_t *desired_value_size)
Fetch an attribute from the persistent datastore.
Definition: datastore_attributes.c:310
struct _datastore_attribute_ datastore_attribute_t
Struct used to store all the data associated to an attribute.
sl_status_t datastore_fetch_attribute_child_id(datastore_attribute_id_t parent_id, uint32_t child_index, datastore_attribute_id_t *child_id)
Fetch the Attribute ID of a child of an attribute from the persistent datastore.
Definition: datastore_attributes.c:464
sl_status_t datastore_fetch_attribute_child(datastore_attribute_id_t parent_id, uint32_t child_index, datastore_attribute_id_t *child_id, uint32_t *type, uint8_t *reported_value, uint8_t *reported_value_size, uint8_t *desired_value, uint8_t *desired_value_size)
Fetch the child of an attribute from the persistent datastore.
Definition: datastore_attributes.c:405
uint32_t sl_status_t
Definition: sl_status.h:139
SL Status Codes.
Struct used to store all the data associated to an attribute.
Definition: datastore_attributes.h:51
uint8_t desired_value[DATASTORE_ATTRIBUTE_VALUE_SIZE]
Definition: datastore_attributes.h:57
uint8_t reported_value_size
Definition: datastore_attributes.h:56
uint8_t desired_value_size
Definition: datastore_attributes.h:58
datastore_attribute_id_t parent_id
Definition: datastore_attributes.h:54
datastore_attribute_id_t id
Definition: datastore_attributes.h:52
uint32_t type
Definition: datastore_attributes.h:53
uint8_t reported_value[DATASTORE_ATTRIBUTE_VALUE_SIZE]
Definition: datastore_attributes.h:55