SimpleOTA client v1.2.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_kv.h
Go to the documentation of this file.
1
13#ifndef SOTA_KV_H
14#define SOTA_KV_H
15
16#include <stdbool.h>
17#include <stddef.h>
18#include <stdint.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27bool sota_kv_get_u8(const char *key, uint8_t *out);
28bool sota_kv_get_u32(const char *key, uint32_t *out);
29bool sota_kv_get_str(const char *key, char *out, size_t cap);
32bool sota_kv_get_blob(const char *key, void *out, size_t len);
33
36bool sota_kv_set_u8(const char *key, uint8_t value);
37bool sota_kv_set_u32(const char *key, uint32_t value);
38bool sota_kv_set_str(const char *key, const char *value);
39bool sota_kv_set_blob(const char *key, const void *value, size_t len);
43bool sota_kv_erase(const char *key);
44
45#ifdef __cplusplus
46}
47#endif
48
49#endif /* SOTA_KV_H */
bool sota_kv_set_blob(const char *key, const void *value, size_t len)
Write a value.
bool sota_kv_set_u32(const char *key, uint32_t value)
Write a value.
bool sota_kv_get_u32(const char *key, uint32_t *out)
Read a value.
bool sota_kv_get_str(const char *key, char *out, size_t cap)
Read a value.
bool sota_kv_erase(const char *key)
Remove a key.
bool sota_kv_get_blob(const char *key, void *out, size_t len)
A blob of exactly len bytes; false for any other length.
bool sota_kv_set_str(const char *key, const char *value)
Write a value.
bool sota_kv_get_u8(const char *key, uint8_t *out)
Read a value.
bool sota_kv_set_u8(const char *key, uint8_t value)
Write a value.