Request handling

nRF5 SDK v15.0.0

Typedefs

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

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
observer Function for receiving notifications.
Return values
NRF_SUCCESS If the operation was successful.
NRF_ERROR_INTERNAL If the init packet in flash is not valid.
NRF_ERROR_INVALID_PARAM If 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_req Request to be handled. The response callback must be non-null.
Return values
NRF_SUCCESS If the command request was executed successfully.
NRF_ERROR_NO_MEM If the scheduler ran out of memory.
NRF_ERROR_INVALID_PARAM If the response callback is NULL.