29#ifndef DATASTORE_ATTRIBUTES_H
30#define DATASTORE_ATTRIBUTES_H
40#define DATASTORE_ATTRIBUTE_VALUE_SIZE 255
89 const uint8_t *reported_value,
90 uint8_t reported_value_size,
91 const uint8_t *desired_value,
92 uint8_t desired_value_size);
125 uint8_t *reported_value,
126 uint8_t *reported_value_size,
127 uint8_t *desired_value,
128 uint8_t *desired_value_size);
181 uint8_t *reported_value,
182 uint8_t *reported_value_size,
183 uint8_t *desired_value,
184 uint8_t *desired_value_size);
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
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