nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Device Firmware Update API.

Device Firmware Update module interface. More...

Modules

 Types and definitions.
 Device Firmware Update module type and definitions.
 

Typedefs

typedef void(* dfu_callback_t )(uint32_t packet, uint32_t result, uint8_t *p_data)
 DFU event callback for asynchronous calls. More...
 

Functions

uint32_t dfu_init (void)
 Function for initializing the Device Firmware Update module. More...
 
void dfu_register_callback (dfu_callback_t callback_handler)
 Function for registering a callback listener for dfu_data_pkt_handle callbacks. More...
 
uint32_t dfu_start_pkt_handle (dfu_update_packet_t *p_packet)
 Function for setting the DFU image size. More...
 
uint32_t dfu_data_pkt_handle (dfu_update_packet_t *p_packet)
 Function for handling DFU data packets. More...
 
uint32_t dfu_init_pkt_handle (dfu_update_packet_t *p_packet)
 Function for handling DFU init packets. More...
 
uint32_t dfu_image_validate (void)
 Function for validating a transferred image after the transfer has completed. More...
 
uint32_t dfu_image_activate (void)
 Function for activating the transfered image after validation has successfully completed. More...
 
void dfu_reset (void)
 Function for reseting the current update procedure and return to initial state. More...
 
uint32_t dfu_bl_image_validate (void)
 Function for validating that new bootloader has been correctly installed. More...
 
uint32_t dfu_sd_image_validate (void)
 Function for validating that new SoftDevicehas been correctly installed. More...
 
uint32_t dfu_bl_image_swap (void)
 Function for swapping existing bootloader with newly received. More...
 
uint32_t dfu_sd_image_swap (void)
 Function for swapping existing SoftDevice with newly received. More...
 
uint32_t dfu_init_pkt_complete (void)
 Function for handling DFU init packet complete. More...
 

Detailed Description

Device Firmware Update module interface.

Typedef Documentation

typedef void(* dfu_callback_t)(uint32_t packet, uint32_t result, uint8_t *p_data)

DFU event callback for asynchronous calls.

Parameters
[in]packetPacket type for which this callback is related. START_PACKET, DATA_PACKET.
[in]resultOperation result code. NRF_SUCCESS when a queued operation was successful.
[in]p_dataPointer to the data to which the operation is related.

Function Documentation

uint32_t dfu_bl_image_swap ( void  )

Function for swapping existing bootloader with newly received.

Returns
NRF_SUCCESS on succesfull swapping. For error code please refer to sd_mbr_command_copy_bl_t.
uint32_t dfu_bl_image_validate ( void  )

Function for validating that new bootloader has been correctly installed.

Returns
NRF_SUCCESS if install was successful. NRF_ERROR_NULL if the images differs.
uint32_t dfu_data_pkt_handle ( dfu_update_packet_t p_packet)

Function for handling DFU data packets.

Parameters
[in]p_packetPointer to the DFU packet.
Returns
NRF_SUCCESS on success, an error_code otherwise.
uint32_t dfu_image_activate ( void  )

Function for activating the transfered image after validation has successfully completed.

Returns
NRF_SUCCESS on success, an error_code otherwise.
uint32_t dfu_image_validate ( void  )

Function for validating a transferred image after the transfer has completed.

Returns
NRF_SUCCESS on success, an error_code otherwise.
uint32_t dfu_init ( void  )

Function for initializing the Device Firmware Update module.

Returns
NRF_SUCCESS on success, an error_code otherwise.
uint32_t dfu_init_pkt_complete ( void  )

Function for handling DFU init packet complete.

Returns
NRF_SUCCESS on success, an error_code otherwise.
uint32_t dfu_init_pkt_handle ( dfu_update_packet_t p_packet)

Function for handling DFU init packets.

Returns
NRF_SUCCESS on success, an error_code otherwise.
void dfu_register_callback ( dfu_callback_t  callback_handler)

Function for registering a callback listener for dfu_data_pkt_handle callbacks.

Parameters
[in]callback_handlerCallback handler for receiving DFU events on completed operations of DFU packets.
void dfu_reset ( void  )

Function for reseting the current update procedure and return to initial state.

This function call will result in a system reset to ensure correct system behavior. The reset will might be scheduled to execute at a later point in time to ensure pending flash operations has completed.

uint32_t dfu_sd_image_swap ( void  )

Function for swapping existing SoftDevice with newly received.

Returns
NRF_SUCCESS on succesfull swapping. For error code please refer to sd_mbr_command_copy_sd_t.
uint32_t dfu_sd_image_validate ( void  )

Function for validating that new SoftDevicehas been correctly installed.

Returns
NRF_SUCCESS if install was successful. NRF_ERROR_NULL if the images differs.
uint32_t dfu_start_pkt_handle ( dfu_update_packet_t p_packet)

Function for setting the DFU image size.

Function sets the DFU image size. This function must be called when an update is started in order to notify the DFU of the new image size. If multiple images are to be transferred within the same update context then this function must be called with size information for each image being transfered. If an image type is not being transfered, e.g. SoftDevice but no Application , then the image size for application must be zero.

Parameters
[in]p_packetPointer to the DFU packet containing information on DFU update process to be started.
Returns
NRF_SUCCESS on success, an error_code otherwise.