Buttonless DFU Service module. More...
Modules | |
Device Firmware Update configuration | |
Data Structures | |
struct | ble_dfu_buttonless_t |
Type holding memory used by Secure DFU Buttonless Service. More... | |
struct | ble_dfu_buttonless_init_t |
Type used to initialize the Secure DFU Buttonless Service. More... | |
Macros | |
#define | BLE_DFU_SOC_OBSERVER_PRIO 1 |
SoC observer priority. More... | |
#define | BOOTLOADER_DFU_START (0xB1) |
#define | BLE_DFU_BUTTONLESS_CHAR_UUID (0x0003) |
#define | BLE_DFU_BUTTONLESS_BONDED_CHAR_UUID (0x0004) |
#define | BLE_NORDIC_VENDOR_BASE_UUID |
Nordic vendor-specific base UUID. More... | |
Typedefs | |
typedef void(* | ble_dfu_buttonless_evt_handler_t )(ble_dfu_buttonless_evt_type_t p_evt) |
Nordic Buttonless DFU Service event handler type. | |
Enumerations | |
enum | ble_dfu_buttonless_evt_type_t { BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE, BLE_DFU_EVT_BOOTLOADER_ENTER, BLE_DFU_EVT_BOOTLOADER_ENTER_FAILED, BLE_DFU_EVT_RESPONSE_SEND_ERROR } |
Nordic Buttonless DFU Service event type . More... | |
enum | ble_dfu_buttonless_rsp_code_t { DFU_RSP_INVALID = 0x00, DFU_RSP_SUCCESS = 0x01, DFU_RSP_OP_CODE_NOT_SUPPORTED = 0x02, DFU_RSP_OPERATION_FAILED = 0x04, DFU_RSP_ADV_NAME_INVALID = 0x05, DFU_RSP_BUSY = 0x06, DFU_RSP_NOT_BONDED = 0x07, DFU_RSP_CCCD_CONFIG_IMPROPER = BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR } |
Enumeration of Bootloader DFU response codes. More... | |
enum | ble_dfu_buttonless_op_code_t { DFU_OP_RESERVED = 0x00, DFU_OP_ENTER_BOOTLOADER = 0x01, DFU_OP_SET_ADV_NAME = 0x02, DFU_OP_RESPONSE_CODE = 0x20 } |
Enumeration of Bootloader DFU Operation codes. More... | |
Functions | |
uint32_t | ble_dfu_buttonless_init (const ble_dfu_buttonless_init_t *p_dfu_init) |
Function for initializing the Device Firmware Update module. More... | |
uint32_t | ble_dfu_buttonless_async_svci_init (void) |
Function for initializing the async SVCI interface. More... | |
uint32_t | ble_dfu_buttonless_backend_init (ble_dfu_buttonless_t *p_dfu) |
Function to initialize the backend Secure DFU Buttonless service which is either supports bonds or not. More... | |
uint32_t | ble_dfu_buttonless_char_add (ble_dfu_buttonless_t *p_dfu) |
Function for adding the buttonless characteristic. More... | |
uint32_t | ble_dfu_buttonless_resp_send (ble_dfu_buttonless_op_code_t op_code, ble_dfu_buttonless_rsp_code_t rsp_code) |
Function for sending a response back to the client. More... | |
void | ble_dfu_buttonless_on_ble_evt (ble_evt_t const *p_ble_evt, void *p_context) |
Function for handling the application's BLE stack events. More... | |
void | ble_dfu_buttonless_on_ctrl_pt_write (ble_gatts_evt_write_t const *p_evt_write) |
Function for handling control point write requests. More... | |
uint32_t | ble_dfu_buttonless_bootloader_start_prepare (void) |
Function for preparing to enter the bootloader. More... | |
uint32_t | ble_dfu_buttonless_bootloader_start_finalize (void) |
Function for finalizing entering the bootloader. More... | |
Buttonless DFU Service module.
This module implements a proprietary Buttonless Secure DFU Service. The service can be configured to support bonds or not. The bond support configuration must correspond to the requirement of Secure DFU bootloader.
#define BLE_DFU_BUTTONLESS_BONDED_CHAR_UUID (0x0004) |
Value combined with vendor-specific base to create Bonded Buttonless characteristic UUID.
#define BLE_DFU_BUTTONLESS_CHAR_UUID (0x0003) |
Value combined with vendor-specific base to create Unbonded Buttonless characteristic UUID.
#define BLE_DFU_SOC_OBSERVER_PRIO 1 |
SoC observer priority.
Priority of this module's SoC event handler.
#define BLE_NORDIC_VENDOR_BASE_UUID |
Nordic vendor-specific base UUID.
#define BOOTLOADER_DFU_START (0xB1) |
Value to set in GPREGRET to boot to DFU mode.
Nordic Buttonless DFU Service event type .
Enumeration of Bootloader DFU response codes.
uint32_t ble_dfu_buttonless_async_svci_init | ( | void | ) |
Function for initializing the async SVCI interface.
This configures the async interface for calling to the bootloader through SVCI interface.
NRF_SUCCESS | on success, otherwise an error code. |
uint32_t ble_dfu_buttonless_backend_init | ( | ble_dfu_buttonless_t * | p_dfu | ) |
Function to initialize the backend Secure DFU Buttonless service which is either supports bonds or not.
[in] | p_dfu | Nordic DFU Service structure. |
uint32_t ble_dfu_buttonless_bootloader_start_finalize | ( | void | ) |
Function for finalizing entering the bootloader.
NRF_SUCCESS | Finalize was started correctly. |
uint32_t ble_dfu_buttonless_bootloader_start_prepare | ( | void | ) |
Function for preparing to enter the bootloader.
Any | error code from calling sd_ble_gap_disconnect. |
uint32_t ble_dfu_buttonless_char_add | ( | ble_dfu_buttonless_t * | p_dfu | ) |
Function for adding the buttonless characteristic.
[in] | p_dfu | Nordic DFU Service structure. |
uint32_t ble_dfu_buttonless_init | ( | const ble_dfu_buttonless_init_t * | p_dfu_init | ) |
Function for initializing the Device Firmware Update module.
[in] | p_dfu_init | Structure containing the values of characteristics needed by the service. |
NRF_SUCCESS | on successful initialization of the service. |
void ble_dfu_buttonless_on_ble_evt | ( | ble_evt_t const * | p_ble_evt, |
void * | p_context | ||
) |
Function for handling the application's BLE stack events.
Handles all events from the BLE stack of interest to the DFU buttonless service.
[in] | p_ble_evt | Event received from the BLE stack. |
[in] | p_context | BLE context structure. |
void ble_dfu_buttonless_on_ctrl_pt_write | ( | ble_gatts_evt_write_t const * | p_evt_write | ) |
Function for handling control point write requests.
Handles write requests to the control point in DFU with bonds or without bonds.
[in] | p_evt_write | GATTS write event. |
uint32_t ble_dfu_buttonless_resp_send | ( | ble_dfu_buttonless_op_code_t | op_code, |
ble_dfu_buttonless_rsp_code_t | rsp_code | ||
) |
Function for sending a response back to the client.
[in] | op_code | Operation code to send the response for. |
[in] | rsp_code | Response code for the operation. |
NRF_SUCCESS | on success, otherwise an error code. |