Unify Framework Lib 1.6.0
attribute_store_internal.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
14#ifndef ATTRIBUTE_STORE_INTERNAL_H
15#define ATTRIBUTE_STORE_INTERNAL_H
16
17// Includes from this component
18#include "attribute_store.h"
19
20// Fixed unique IDs for the datastore
22#define ATTRIBUTE_STORE_NULL_ID (attribute_store_node_t)0
24#define ATTRIBUTE_STORE_ROOT_ID (attribute_store_node_t)1
25
29#define STORE_ATTRIBUTE(node) \
30 datastore_store_attribute(node->id, \
31 node->type, \
32 node->parent_node->id, \
33 &node->reported_value[0], \
34 node->reported_value.size(), \
35 &node->desired_value[0], \
36 node->desired_value.size())
37
41#define STORE_ROOT_ATTRIBUTE(root_node) \
42 datastore_store_attribute(root_node->id, \
43 root_node->type, \
44 ATTRIBUTE_STORE_NULL_ID, \
45 &root_node->reported_value[0], \
46 root_node->reported_value.size(), \
47 &root_node->desired_value[0], \
48 root_node->desired_value.size())
49
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
61
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif // ATTRIBUTE_STORE_INTERNAL_H
sl_status_t attribute_store_save_to_datastore()
Saves the entire attribute store to the datastore.
sl_status_t attribute_store_load_from_datastore()
Loads the entire attribute store from the datastore.
uint32_t sl_status_t
Definition: sl_status.h:139