KV Storage#

Provides persistent storage interface for key mapped values.

Functions#

sid_error_t

Initialize the key value storage subsystem.

sid_error_t

Deinitialize the key value storage subsystem.

sid_error_t
sid_pal_storage_kv_record_get(uint16_t group, uint16_t key, void *p_data, uint32_t len)

Get a value using its group and key IDs.

sid_error_t
sid_pal_storage_kv_record_get_len(uint16_t group, uint16_t key, uint32_t *p_len)

Get the size of a value using its group and key IDs.

sid_error_t
sid_pal_storage_kv_record_set(uint16_t group, uint16_t key, void const *p_data, uint32_t len)

Set a value using its group and key IDs.

sid_error_t
sid_pal_storage_kv_record_delete(uint16_t group, uint16_t key)

Delete a value using its group and key IDs.

sid_error_t

Delete all values in a group.

Macros#

#define
SID_PAL_KV_STORE_MAX_LENGTH_BYTES 48

Maximum length in bytes for the Key-Value store.

#define
SID_PAL_STORAGE_KV_INTERNAL_PROTOCOL_GROUP_ID 0x2000

Group ID for the internal protocol of the Key-Value storage.

#define
SID_PAL_STORAGE_KV_INTERNAL_CONFIG_GROUP_ID 0x3456

Group ID for the internal configuration of the Key-Value storage.

#define
SID_PAL_STORAGE_KV_INTERNAL_BULK_DATA_TRANSFER_GROUP_ID 0x4567

Group ID for the internal bulk data transfer of the Key-Value storage.

Function Documentation#

sid_pal_storage_kv_init#

sid_error_t sid_pal_storage_kv_init (void )

Initialize the key value storage subsystem.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sid_pal_storage_kv_deinit#

sid_error_t sid_pal_storage_kv_deinit (void )

Deinitialize the key value storage subsystem.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sid_pal_storage_kv_record_get#

sid_error_t sid_pal_storage_kv_record_get (uint16_t group, uint16_t key, void * p_data, uint32_t len)

Get a value using its group and key IDs.

Parameters
TypeDirectionArgument NameDescription
uint16_t[in]group

Group

uint16_t[in]key

Key

void *[out]p_data

Pointer to output buffer to contain the value

uint32_t[in]len

Maximum length of buffer pointed to by p_data in bytes


sid_pal_storage_kv_record_get_len#

sid_error_t sid_pal_storage_kv_record_get_len (uint16_t group, uint16_t key, uint32_t * p_len)

Get the size of a value using its group and key IDs.

Parameters
TypeDirectionArgument NameDescription
uint16_t[in]group

Group

uint16_t[in]key

Key

uint32_t *[out]p_len

Pointer to integer to contain the size of the value in bytes


sid_pal_storage_kv_record_set#

sid_error_t sid_pal_storage_kv_record_set (uint16_t group, uint16_t key, void const * p_data, uint32_t len)

Set a value using its group and key IDs.

Parameters
TypeDirectionArgument NameDescription
uint16_t[in]group

Group

uint16_t[in]key

Key

void const *[in]p_data

Pointer to input buffer which contains the value

uint32_t[in]len

The size of the input value in bytes


sid_pal_storage_kv_record_delete#

sid_error_t sid_pal_storage_kv_record_delete (uint16_t group, uint16_t key)

Delete a value using its group and key IDs.

Parameters
TypeDirectionArgument NameDescription
uint16_t[in]group

Group

uint16_t[in]key

Key


sid_pal_storage_kv_group_delete#

sid_error_t sid_pal_storage_kv_group_delete (uint16_t group)

Delete all values in a group.

Parameters
TypeDirectionArgument NameDescription
uint16_t[in]group

Group