函数 | |
int | aos_kv_init (void) |
void | aos_kv_deinit (void) |
int | aos_kv_set (const char *key, const void *value, int len, int sync) |
int | aos_kv_get (const char *key, void *buffer, int *buffer_len) |
int | aos_kv_del (const char *key) |
int | aos_kv_del_by_prefix (const char *prefix) |
int | aos_kv_secure_set (const char *key, const void *value, int len, int sync) |
int | aos_kv_secure_get (const char *key, void *buffer, int *buffer_len) |
void aos_kv_deinit | ( | void | ) |
Deinit the kv module.
@retrun none
int aos_kv_del | ( | const char * | key | ) |
Delete the KV pair by its key.
[in] | key | the key of the KV pair to delete. |
int aos_kv_del_by_prefix | ( | const char * | prefix | ) |
Delete the KV pair by its prefix.
[in] | prefix | the prefix of the kv pair which is need to delete. |
int aos_kv_get | ( | const char * | key, |
void * | buffer, | ||
int * | buffer_len | ||
) |
Get the KV pair's value stored in buffer by its key.
[in] | key | the key of the KV pair to get. |
[out] | buffer | the memory to store the value. |
[in-out] | buffer_len in: the length of the input buffer. out: the real length of the value. |
int aos_kv_init | ( | void | ) |
Init the kv module.
@retrun 0 on success, otherwise will be failed.
int aos_kv_secure_get | ( | const char * | key, |
void * | buffer, | ||
int * | buffer_len | ||
) |
Get the KV pair's value stored in buffer by its key with decrypt.
[in] | key | the key of the KV pair to get. |
[out] | buffer | the memory to store the value. |
[in-out] | buffer_len in: the length of the input buffer. out: the real length of the value. |
int aos_kv_secure_set | ( | const char * | key, |
const void * | value, | ||
int | len, | ||
int | sync | ||
) |
Add a new KV pair with encryption.
[in] | key | the key of the KV pair. |
[in] | value | the value of the KV pair. |
[in] | len | the length of the value. |
[in] | sync | save the KV pair to flash right now (should always be 1). |
int aos_kv_set | ( | const char * | key, |
const void * | value, | ||
int | len, | ||
int | sync | ||
) |
Add a new KV pair.
[in] | key | the key of the KV pair. |
[in] | value | the value of the KV pair. |
[in] | len | the length of the value. |
[in] | sync | save the KV pair to flash right now (should always be 1). |