Zigbee Protocol Controller 1.6.0
datastore.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
27#ifndef DATASTORE_H
28#define DATASTORE_H
29
30#include <inttypes.h>
31#include <stdbool.h>
32#include "sl_status.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38typedef const char *datastore_key_t;
39
57sl_status_t datastore_init(const char *database_path);
58
73
82
90
99
111
130 const uint8_t *value,
131 unsigned int size);
132
146 datastore_fetch_arr(datastore_key_t key, uint8_t *value, unsigned int *size);
147
155
163
171
172#ifdef __cplusplus
173}
174#endif
175
176#endif //DATASTORE_H
bool datastore_contains_int(datastore_key_t key)
Check if the datastore contains an int value for given key.
Definition: datastore.c:293
sl_status_t datastore_store_arr(datastore_key_t key, const uint8_t *value, unsigned int size)
Store array in the persistent datastore.
Definition: datastore.c:279
sl_status_t datastore_store_int(datastore_key_t key, int64_t value)
Store integer in the persistent datastore.
Definition: datastore.c:269
sl_status_t datastore_fetch_int(datastore_key_t key, int64_t *value)
Fetch integer from the persistent datastore.
Definition: datastore.c:274
sl_status_t datastore_commit_transaction()
commit an open transaction
Definition: datastore.c:258
sl_status_t datastore_start_transaction()
start a datastore transaction
Definition: datastore.c:240
sl_status_t datastore_teardown()
Tear down the Datastore component.
Definition: datastore_fixt.c:113
sl_status_t datastore_fetch_arr(datastore_key_t key, uint8_t *value, unsigned int *size)
Fetch array from the persistent datastore.
Definition: datastore.c:286
bool datastore_is_initialized()
Checks if the datastore is initialized and can be used.
Definition: datastore.c:303
bool datastore_contains_arr(datastore_key_t key)
Check if the datastore contains an array value for given key.
Definition: datastore.c:298
sl_status_t datastore_init(const char *database_path)
Initialize the Datastore component.
Definition: datastore_fixt.c:99
const char * datastore_key_t
Definition: datastore.h:38
uint32_t sl_status_t
Definition: sl_status.h:139
SL Status Codes.