NCP DFU Utility#

Implements the Firmware Update Information Status message assembly, with provided interfaces for setting FWIDs and URIs with indexing. This component is prepared for integration into NCP applications.

Functions#

sl_status_t
sl_btmesh_ncp_dfu_set_fwid(uint8_t idx, uint8_t len, uint8_t *data)
sl_status_t
sl_btmesh_ncp_dfu_set_uri(uint8_t idx, uint8_t type, uint8_t len, uint8_t *data)
void
sl_btmesh_ncp_dfu_handle_cmd(void *data, bool *cmd_handled)

Macros#

#define
USER_SUB_CMD_URI_ID_WRT '0'

User sub-command to write FW URI.

#define
USER_SUB_CMD_URI_ID_APP '1'

User sub-command to append to FW URI.

Function Documentation#

sl_btmesh_ncp_dfu_set_fwid#

sl_status_t sl_btmesh_ncp_dfu_set_fwid (uint8_t idx, uint8_t len, uint8_t * data)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]idx

Index of the FW

uint8_t[in]len

Length of the data

uint8_t *[in]data

Firmware ID data; containing CID and version information

Sets the Firmware ID for the given index, as part of the FW information

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_INVALID_PARAMETER: If length is less than 2 or greater than 108

  • SL_STATUS_NO_MORE_RESOURCE: In case memory allocation error


sl_btmesh_ncp_dfu_set_uri#

sl_status_t sl_btmesh_ncp_dfu_set_uri (uint8_t idx, uint8_t type, uint8_t len, uint8_t * data)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]idx

Index of the FW

uint8_t[in]type

Type of the command; '0' erases and writes new URI, '1' appends to existing URI.

uint8_t[in]len

Length of the data

uint8_t *[in]data

The data to write or append

Sets the URI for given index, as part of the FW information

Returns

  • Status code

Return values

  • SL_STATUS_OK: In case of success

  • SL_STATUS_NO_MORE_RESOURCE: In case of memory allocation error

  • SL_STATUS_INVALID_PARAMETER: In case the combined length of the URI is longer than 255 bytes


sl_btmesh_ncp_dfu_handle_cmd#

void sl_btmesh_ncp_dfu_handle_cmd (void * data, bool * cmd_handled)
Parameters
TypeDirectionArgument NameDescription
void *[in]data

Pointer to the command.

bool *[inout]cmd_handled

Status of the command: true - cmd handled, no further interpretation is required false - cmd unhandled, interpretation is required

User command (message_to_target) handler callback. Handles user defined commands received from NCP host.

Note

  • If the value of the parameter 'cmd_handled' is false, the incoming command needs to be interpreted. If the command is recognized and handled, the 'cmd_handled' flag should be set to true. If the value of the 'cmd_handled' parameter is already true, the function will return without executing any further operations.