NVM#
NVM.
Provide an interface to manage user data objects (key/value pairs) in the flash memory. User data stored within the flash memory is persistent across reset and power cycling of the device. Because Bluetooth bondings are also stored in the flash area, in addition to the flash storage size, the space available for user data also depends on the number of bondings the device has at the time.
The Bluetooth stack uses the NVM3 data storage driver to implement the commmands in this class. Applications can also use the NVM3 APIs directly.
In NVM3, the flash store size is configurable and the minimum is 3 flash pages. The maximum data object size is configurable up to 4096 bytes. A Bluetooth bonding uses maximum 110 bytes for secure connections and 138 bytes for legacy pairing. For more details, see AN1135 "Using Third Generation NonVolatile Memory (NVM3) Data Storage".
Modules#
Functions#
Macros#
Function Documentation#
sl_bt_nvm_save#
sl_status_t sl_bt_nvm_save (uint16_t key, size_t value_len, const uint8_t * value)
[in] | key | NVM key |
[in] | value_len | Length of data in |
[in] | value | Value to store into the specified NVM key |
Store a value into the specified NVM key. Allowed NVM keys are in range from 0x4000 to 0x407F. At most, 56 bytes user data can be stored in one NVM key. The error code 0x018a (command_too_long) is returned if the value data is more than 56 bytes.
Returns
SL_STATUS_OK if successful. Error code otherwise.
9392
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_nvm_load#
sl_status_t sl_bt_nvm_load (uint16_t key, size_t max_value_size, size_t * value_len, uint8_t * value)
[in] | key | NVM key of the value to be retrieved |
[in] | max_value_size | Size of output buffer passed in |
[out] | value_len | On return, set to the length of output data written to |
[out] | value | The returned value of the specified NVM key |
Retrieve the value of the specified NVM key.
Returns
SL_STATUS_OK if successful. Error code otherwise.
9409
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_nvm_erase#
sl_status_t sl_bt_nvm_erase (uint16_t key)
[in] | key | NVM key to delete |
Delete a single NVM key and its value from the persistent store.
Returns
SL_STATUS_OK if successful. Error code otherwise.
9423
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_nvm_erase_all#
sl_status_t sl_bt_nvm_erase_all ()
Delete all NVM keys and their corresponding values.
Returns
SL_STATUS_OK if successful. Error code otherwise.
9433
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
Macro Definition Documentation#
sl_bt_cmd_nvm_save_id#
#define sl_bt_cmd_nvm_save_idValue:
0x020d0020
9357
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_cmd_nvm_load_id#
#define sl_bt_cmd_nvm_load_idValue:
0x030d0020
9358
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_cmd_nvm_erase_id#
#define sl_bt_cmd_nvm_erase_idValue:
0x040d0020
9359
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_cmd_nvm_erase_all_id#
#define sl_bt_cmd_nvm_erase_all_idValue:
0x010d0020
9360
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_nvm_save_id#
#define sl_bt_rsp_nvm_save_idValue:
0x020d0020
9361
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_nvm_load_id#
#define sl_bt_rsp_nvm_load_idValue:
0x030d0020
9362
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_nvm_erase_id#
#define sl_bt_rsp_nvm_erase_idValue:
0x040d0020
9363
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_nvm_erase_all_id#
#define sl_bt_rsp_nvm_erase_all_idValue:
0x010d0020
9364
of file /mnt/raid/workspaces/ws.iS2YF8Lrv/overlay/gsdk/protocol/bluetooth/build/native/sw/bgapi/inc/sl_bt_api.h