DFU settings

nRF5 SDK v14.0.0

Functions

ret_code_t nrf_dfu_settings_write ( dfu_flash_callback_t callback)
Function for writing DFU settings to flash. More...
void nrf_dfu_settings_init (bool sd_irq_initialized)
Function for initializing the DFU settings module.
ret_code_t nrf_dfu_settings_peer_data_write ( nrf_dfu_peer_data_t *p_data)
Function for storing peer data received through an SVCI call in DFU settings. More...
ret_code_t nrf_dfu_settings_peer_data_copy ( nrf_dfu_peer_data_t *p_data)
Function for copying peer data from DFU settings to RAM. More...
bool nrf_dfu_settings_peer_data_is_valid (void)
Function for validating peer data in DFU settings. More...
ret_code_t nrf_dfu_settings_adv_name_write ( nrf_dfu_adv_name_t *p_adv_name)
Function for storing an advertisement name received through an SVCI call in DFU settings. More...
ret_code_t nrf_dfu_settings_adv_name_copy ( nrf_dfu_adv_name_t *p_adv_name)
Function for copying the advertisement name from DFU settings to RAM. More...
bool nrf_dfu_settings_adv_name_is_valid (void)
Function for validating advertisement data in DFU settings. More...
ret_code_t nrf_dfu_settings_additional_erase (void)
Function for erasing additional data in DFU settings. More...

Detailed Description

Function Documentation

ret_code_t nrf_dfu_settings_additional_erase ( void )

Function for erasing additional data in DFU settings.

Note
Erasing additional data in DFU settings is only possible if nrf_dfu_flash is initialized to not use SoftDevice calls.
Return values
NRF_SUCCESS Additional data was successfully erased.
Any other error code reported by nrf_dfu_flash
ret_code_t nrf_dfu_settings_adv_name_copy ( nrf_dfu_adv_name_t * p_adv_name )

Function for copying the advertisement name from DFU settings to RAM.

Parameters
[in,out] p_adv_name Structure to copy the new advertisement name to.
Return values
NRF_SUCCESS Advertisement name was successfully copied.
NRF_ERROR_NULL p_adv_name was NULL.
bool nrf_dfu_settings_adv_name_is_valid ( void )

Function for validating advertisement data in DFU settings.

Return values
True if advertisement name is validated by CRC, false if not.
ret_code_t nrf_dfu_settings_adv_name_write ( nrf_dfu_adv_name_t * p_adv_name )

Function for storing an advertisement name received through an SVCI call in DFU settings.

Note
The content of the type is verifyable by a CRC-value stored inside the struct.
The storage operation is an asynchronous progress. Success will be notified through system events raised by the SoftDevice.
Parameters
[in] p_adv_name Structure holding information about the new advertisement name.
Return values
NRF_SUCCESS Asynchronous operation was successfully started.
NRF_ERROR_NULL p_adv_name was NULL.
Any other error code reported by SoftDevice API calls.
ret_code_t nrf_dfu_settings_peer_data_copy ( nrf_dfu_peer_data_t * p_data )

Function for copying peer data from DFU settings to RAM.

Parameters
[in,out] p_data Structure to copy peer data to.
Return values
NRF_SUCCESS Peer data was successfully copied.
NRF_ERROR_NULL p_data was NULL.
bool nrf_dfu_settings_peer_data_is_valid ( void )

Function for validating peer data in DFU settings.

Return values
True if peer data is validated by CRC, false if not.
ret_code_t nrf_dfu_settings_peer_data_write ( nrf_dfu_peer_data_t * p_data )

Function for storing peer data received through an SVCI call in DFU settings.

Note
The content of the type can be verified by a CRC value stored inside the struct If the CRC value is 0xFFFFFFFF, it means that no data is set.
The storage operation is an asynchronous progress. Success will be notified through system events raised by the SoftDevice.
Parameters
[in] p_data Peer data to be stored in flash.
Return values
NRF_SUCCESS Asynchronous operation was successfully started.
NRF_ERROR_NULL p_data was NULL.
Any other error code reported by SoftDevice API calls.
ret_code_t nrf_dfu_settings_write ( dfu_flash_callback_t callback )

Function for writing DFU settings to flash.

Parameters
[in] callback Pointer to a function that is called after completing the write operation.
Return values
NRF_SUCCESS If the write process was successfully initiated.
NRF_ERROR_INTERNAL If a flash error occurred.

Variable Documentation

nrf_dfu_settings_t s_dfu_settings

Global settings.

Note
Using this variable is not thread-safe.