nRF5 SDK v15.3.0
Data Structures | Typedefs | Enumerations | Functions | Variables
Request handling

Data Structures

struct  nrf_dfu_response_protocol_t
 NRF_DFU_OP_PROTOCOL_VERSION response details. More...
 
struct  nrf_dfu_response_hardware_t
 NRF_DFU_OP_HARDWARE_VERSION response details. More...
 
struct  nrf_dfu_response_firmware_t
 NRF_DFU_OP_FIRMWARE_VERSION response details. More...
 
struct  nrf_dfu_response_select_t
 NRF_DFU_OP_OBJECT_SELECT response details. More...
 
struct  nrf_dfu_response_create_t
 NRF_DFU_OP_OBJECT_CREATE response details. More...
 
struct  nrf_dfu_response_write_t
 NRF_DFU_OP_OBJECT_WRITE response details. More...
 
struct  nrf_dfu_response_crc_t
 NRF_DFU_OP_CRC_GET response details. More...
 
struct  nrf_dfu_response_ping_t
 NRF_DFU_OP_PING response details. More...
 
struct  nrf_dfu_response_mtu_t
 NRF_DFU_OP_MTU_GET response details. More...
 
struct  nrf_dfu_response_t
 DFU response message. More...
 
struct  nrf_dfu_request_firmware_t
 NRF_DFU_OP_FIRMWARE_VERSION request details. More...
 
struct  nrf_dfu_request_select_t
 NRF_DFU_OP_OBJECT_SELECT request details. More...
 
struct  nrf_dfu_request_create_t
 NRF_DFU_OP_OBJECT_CREATE request details. More...
 
struct  nrf_dfu_request_write_t
 NRF_DFU_OP_OBJECT_WRITE request details. More...
 
struct  nrf_dfu_request_ping_t
 NRF_DFU_OP_PING request details. More...
 
struct  nrf_dfu_request_mtu_t
 NRF_DFU_OP_MTU_GET request details. More...
 
struct  nrf_dfu_request_prn_t
 NRF_DFU_OP_RECEIPT_NOTIF_SET request details. More...
 
struct  nrf_dfu_request_t
 DFU request. More...
 

Typedefs

typedef void(* nrf_dfu_response_callback_t )(nrf_dfu_response_t *p_res, void *p_context)
 

Enumerations

enum  nrf_dfu_obj_type_t {
  NRF_DFU_OBJ_TYPE_INVALID,
  NRF_DFU_OBJ_TYPE_COMMAND,
  NRF_DFU_OBJ_TYPE_DATA
}
 DFU object types. More...
 
enum  nrf_dfu_op_t {
  NRF_DFU_OP_PROTOCOL_VERSION = 0x00,
  NRF_DFU_OP_OBJECT_CREATE = 0x01,
  NRF_DFU_OP_RECEIPT_NOTIF_SET = 0x02,
  NRF_DFU_OP_CRC_GET = 0x03,
  NRF_DFU_OP_OBJECT_EXECUTE = 0x04,
  NRF_DFU_OP_OBJECT_SELECT = 0x06,
  NRF_DFU_OP_MTU_GET = 0x07,
  NRF_DFU_OP_OBJECT_WRITE = 0x08,
  NRF_DFU_OP_PING = 0x09,
  NRF_DFU_OP_HARDWARE_VERSION = 0x0A,
  NRF_DFU_OP_FIRMWARE_VERSION = 0x0B,
  NRF_DFU_OP_ABORT = 0x0C,
  NRF_DFU_OP_RESPONSE = 0x60,
  NRF_DFU_OP_INVALID = 0xFF
}
 DFU protocol operation. More...
 
enum  nrf_dfu_result_t {
  NRF_DFU_RES_CODE_INVALID = 0x00,
  NRF_DFU_RES_CODE_SUCCESS = 0x01,
  NRF_DFU_RES_CODE_OP_CODE_NOT_SUPPORTED = 0x02,
  NRF_DFU_RES_CODE_INVALID_PARAMETER = 0x03,
  NRF_DFU_RES_CODE_INSUFFICIENT_RESOURCES = 0x04,
  NRF_DFU_RES_CODE_INVALID_OBJECT = 0x05,
  NRF_DFU_RES_CODE_UNSUPPORTED_TYPE = 0x07,
  NRF_DFU_RES_CODE_OPERATION_NOT_PERMITTED = 0x08,
  NRF_DFU_RES_CODE_OPERATION_FAILED = 0x0A,
  NRF_DFU_RES_CODE_EXT_ERROR = 0x0B
}
 DFU operation result code. More...
 
enum  nrf_dfu_firmware_type_t {
  NRF_DFU_FIRMWARE_TYPE_SOFTDEVICE = 0x00,
  NRF_DFU_FIRMWARE_TYPE_APPLICATION = 0x01,
  NRF_DFU_FIRMWARE_TYPE_BOOTLOADER = 0x02,
  NRF_DFU_FIRMWARE_TYPE_UNKNOWN = 0xFF
}
 

Functions

ret_code_t nrf_dfu_req_handler_init (nrf_dfu_observer_t observer)
 Function for initializing the request handling module. More...
 
ret_code_t nrf_dfu_req_handler_on_req (nrf_dfu_request_t *p_req)
 Function for scheduling processing of a DFU request. More...
 

Variables

 ANON_UNIONS_ENABLE
 
 ANON_UNIONS_DISABLE
 

Detailed Description

Enumeration Type Documentation

DFU object types.

Enumerator
NRF_DFU_OBJ_TYPE_INVALID 

Invalid object type.

NRF_DFU_OBJ_TYPE_COMMAND 

Command object.

NRF_DFU_OBJ_TYPE_DATA 

Data object.

DFU protocol operation.

Enumerator
NRF_DFU_OP_PROTOCOL_VERSION 

Retrieve protocol version.

NRF_DFU_OP_OBJECT_CREATE 

Create selected object.

NRF_DFU_OP_RECEIPT_NOTIF_SET 

Set receipt notification.

NRF_DFU_OP_CRC_GET 

Request CRC of selected object.

NRF_DFU_OP_OBJECT_EXECUTE 

Execute selected object.

NRF_DFU_OP_OBJECT_SELECT 

Select object.

NRF_DFU_OP_MTU_GET 

Retrieve MTU size.

NRF_DFU_OP_OBJECT_WRITE 

Write selected object.

NRF_DFU_OP_PING 

Ping.

NRF_DFU_OP_HARDWARE_VERSION 

Retrieve hardware version.

NRF_DFU_OP_FIRMWARE_VERSION 

Retrieve firmware version.

NRF_DFU_OP_ABORT 

Abort the DFU procedure.

NRF_DFU_OP_RESPONSE 

Response.

DFU operation result code.

Enumerator
NRF_DFU_RES_CODE_INVALID 

Invalid opcode.

NRF_DFU_RES_CODE_SUCCESS 

Operation successful.

NRF_DFU_RES_CODE_OP_CODE_NOT_SUPPORTED 

Opcode not supported.

NRF_DFU_RES_CODE_INVALID_PARAMETER 

Missing or invalid parameter value.

NRF_DFU_RES_CODE_INSUFFICIENT_RESOURCES 

Not enough memory for the data object.

NRF_DFU_RES_CODE_INVALID_OBJECT 

Data object does not match the firmware and hardware requirements, the signature is wrong, or parsing the command failed.

NRF_DFU_RES_CODE_UNSUPPORTED_TYPE 

Not a valid object type for a Create request.

NRF_DFU_RES_CODE_OPERATION_NOT_PERMITTED 

The state of the DFU process does not allow this operation.

NRF_DFU_RES_CODE_OPERATION_FAILED 

Operation failed.

NRF_DFU_RES_CODE_EXT_ERROR 

Extended error. The next byte of the response contains the error code of the extended error (see nrf_dfu_ext_error_code_t.

Function Documentation

ret_code_t nrf_dfu_req_handler_init ( nrf_dfu_observer_t  observer)

Function for initializing the request handling module.

Parameters
observerCallback function for receiving notifications.
Return values
NRF_SUCCESSIf the operation was successful.
NRF_ERROR_INTERNALIf the init packet in flash is not valid.
NRF_ERROR_INVALID_PARAMIf observer is not provided.
ret_code_t nrf_dfu_req_handler_on_req ( nrf_dfu_request_t p_req)

Function for scheduling processing of a DFU request.

Requests are processed asynchronously by the scheduler.

Parameters
[in]p_reqRequest to be handled. The response callback must be non-null.
Return values
NRF_SUCCESSIf the command request was executed successfully.
NRF_ERROR_NO_MEMIf the scheduler ran out of memory.
NRF_ERROR_INVALID_PARAMIf the response callback is NULL.

Documentation feedback | Developer Zone | Subscribe | Updated