Firmware Update APIs#

Functions#

int32_t

Wireless firmware upgrade request. This is a blocking API.

int32_t
rsi_fwup(uint8_t type, uint8_t *content, uint16_t length)

Helper function for actual APIs.

int32_t
rsi_fwup_start(uint8_t *rps_header)

Send the RPS header content of firmware file. This is a blocking API.

int32_t
rsi_fwup_load(uint8_t *content, uint16_t length)

Send the firmware file content. This is a blocking API.

int32_t
rsi_http_fw_update(uint8_t flags, uint8_t *ip_address, uint16_t port, uint8_t *resource, uint8_t *host_name, uint8_t *extended_header, uint8_t *user_name, uint8_t *password, void(*http_otaf_response_handler)(uint16_t status, const uint8_t *buffer))

Initiate firmware update from an HTTP server. This is non-blocking API.

Function Documentation#

rsi_req_wireless_fwup#

int32_t rsi_req_wireless_fwup (void )

Wireless firmware upgrade request. This is a blocking API.

Parameters
[in]

Returns

  • 0 - Success Negative Value - Failure -2 - Invalid parameters -4 - Buffer not available to serve the command

Note

  • 1. For Wireless firmware upgrade, it will take approx. 85 sec duration for upgrading the firmware of 1.5 MB file.

  • 2. Refer to Error Codes section for the description of the above error codes Error Codes.


Definition at line 609 of file network/protocols/http_server/rsi_http_server.c

rsi_fwup#

static int32_t rsi_fwup (uint8_t type, uint8_t * content, uint16_t length)

Helper function for actual APIs.

Parameters
[in]type

- Firmware upgrade chunk type

[in]content

- Firmware content

[in]length

- Length of the content

Returns

  • Zero - Success 3 - Firmware upgrade completed successfully Negative Value - Failure


Definition at line 35 of file network/protocols/rsi_firmware_upgradation.c

rsi_fwup_start#

int32_t rsi_fwup_start (uint8_t * rps_header)

Send the RPS header content of firmware file. This is a blocking API.

Parameters
[in]rps_header

- Pointer to the RPS header content

Returns

  • 0 - Success Negative Value - Failure -2 - Invalid Parameters -4 - Buffer not available to serve the command

Note

  • Refer to Error Codes section for the description of the above error codes Error Codes.


Definition at line 122 of file network/protocols/rsi_firmware_upgradation.c

References RSI_SUCCESS , and SL_PRINTF

rsi_fwup_load#

int32_t rsi_fwup_load (uint8_t * content, uint16_t length)

Send the firmware file content. This is a blocking API.

Parameters
[in]content

- Pointer to the firmware file content

[in]length

- Length of the content

Returns

  • 0 - Success Negative Value - Failure 3 - Firmware upgradate is completed successfully -2 - Invalid parameters -4 - Buffer not availableto serve the command

Note

  • Refer to Error Codes section for the description of the above error codes Error Codes.


Definition at line 151 of file network/protocols/rsi_firmware_upgradation.c

References RSI_SUCCESS , and SL_PRINTF

rsi_http_fw_update#

int32_t rsi_http_fw_update (uint8_t flags, uint8_t * ip_address, uint16_t port, uint8_t * resource, uint8_t * host_name, uint8_t * extended_header, uint8_t * user_name, uint8_t * password, void(*)(uint16_t status, const uint8_t *buffer) http_otaf_response_handler, status, buffer)

Initiate firmware update from an HTTP server. This is non-blocking API.

Parameters
[in]flags

- Select version and security

Flags

Macro

Description

BIT(0)

RSI_IPV6

Set this bit to enable IPv6 , by default it is configured to IPv4

BIT(1)

RSI_SSL_ENABLE

Set this bit to enable SSL feature

BIT(2)

RSI_SSL_V_1_0

Set this bit to support SSL TLS Version 1.0 if HTTPS is enabled

BIT(3)

RSI_SSL_V_1_2

Set this bit to support SSL_TLS Version 1.2 if HTTPS is enabled

BIT(4)

RSI_SSL_V_1_1

Set this bit to support SSL_TLS Version 1.1 if HTTPS is enabled

BIT(5)

HTTP_POST_DATA

Set this bit to enable Http_post large data feature

BIT(6)

HTTP_V_1_1

Set this bit to use HTTP version 1.1

[in]ip_address

- Server IP address

[in]port

- Port number, default : 80 - HTTP, 443 - HTTPS

[in]resource

- URL string for requested resource

[in]host_name

- Host name

[in]extended_header

- Extender header if present

[in]user_name

- Username for server Authentication

[in]password

- Password for server Authentication

[in]http_otaf_response_handler

- Callback is called when asynchronous response is received from module for HTTP firmware update request

[out]status

- Status code represent RSI_SUCCESS : Firmware update success oOther expected error codes : BBED,BB40,BB38,BBD2,FF74,FFF4

[out]buffer

- NULL

Returns

  • 0 - Success Negative value - Failure


Definition at line 53 of file network/protocols/rsi_http_ota_fw_up.c