Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

DFU BLE packet handling in Application

DFU BLE packet handling in Application

DFU BLE packet handling for application. More...

Typedefs

typedef void(* dfu_app_reset_prepare_t )(void)
 DFU Application reset prepare function.

Functions

void dfu_app_on_dfu_evt (ble_dfu_t *p_dfu, ble_dfu_evt_t *p_evt)
 Function for handling of ble_dfu_evt_t from DFU Service.
void dfu_app_reset_prepare_set (dfu_app_reset_prepare_t reset_prepare_func)
 Function for registering for reset prepare calls.
void dfu_app_set_dm_handle (dm_handle_t const *p_dm_handle)
 Function for setting Device manager handle for current BLE connection.

Detailed Description

DFU BLE packet handling for application.

This module implements handling of DFU packets transmitted over BLE for switching from application mode to Bootloader running full DFU service. This module only handles the StartDFU packet allowing for any BLE application to expose support for the DFU service. Actual DFU service will execute in dedicated environment after a BLE disconnect and reset of the nRF51 chip. The host must then reconnect and can continue the update procedure with access to full DFU service.

Note:
The application must propagate dfu events to the DFU App handler module by calling dfu_app_on_dfu_evt() from the ble_dfu_evt_handler_t callback.

Typedef Documentation

typedef void(* dfu_app_reset_prepare_t)(void)

DFU Application reset prepare function.

This function is a callback which allows the application to prepare for an upcoming application reset.

Definition at line 44 of file dfu_app_handler.h.


Function Documentation

void dfu_app_on_dfu_evt ( ble_dfu_t p_dfu,
ble_dfu_evt_t p_evt 
)

Function for handling of ble_dfu_evt_t from DFU Service.

The application must inject this function into the DFU service or propagate DFU events to dfu_app_handler module by calling this function in application specific DFU event handler.

Parameters:
[in]p_dfuPointer to the DFU Service structure for which the include event relates.
[in]p_evtPointer to the DFU event.

Definition at line 114 of file dfu_app_handler.c.

void dfu_app_reset_prepare_set ( dfu_app_reset_prepare_t  reset_prepare_func )

Function for registering for reset prepare calls.

The function provided will be executed before reseting the system into Bootloader/DFU mode. By setting this function the caller will be notified prior to the reset and can thus prepare the application for reset. As example the application can gracefully disconnect any peers on BLE, turning of LEDS, ensure all pending flash operations has completed, etc.

Parameters:
[in]reset_prepare_funcFunction to be execute prior to a reset.

Definition at line 146 of file dfu_app_handler.c.

void dfu_app_set_dm_handle ( dm_handle_t const *  p_dm_handle )

Function for setting Device manager handle for current BLE connection.

Parameters:
[in]p_dm_handlePointer to device manager handle of current connection.

Definition at line 152 of file dfu_app_handler.c.