Firmware Update from Module#
This section provides a reference to the APIs used to perform firmware updates from the module.
Functions#
Create an OTAF client.
Sends an HTTP request to a specified server URL with optional data and headers, and facilitates firmware downloads from the server.
Function Documentation#
sl_si91x_ota_firmware_upgradation#
sl_status_t sl_si91x_ota_firmware_upgradation (sl_ip_address_t server_ip, uint16_t server_port, uint16_t chunk_number, uint16_t timeout, uint16_t tcp_retry_count, bool asynchronous)
Create an OTAF client.
[in] | server_ip | OTAF server IP address sl_ip_address_t |
[in] | server_port | OTAF server port number. |
[in] | chunk_number | Firmware content request chunk number. |
[in] | timeout | TCP receive packet timeout. |
[in] | tcp_retry_count | TCP retransmissions count. |
[in] | asynchronous | OTAF upgrade done aynchronously when this is set, else synchronous upgrade. |
Initialize the client with a given configuration.
Pre-conditions:
sl_net_up API needs to be called before this API.
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
For safe firmware upgrade via TCP server,
it will take approx. 65 sec duration for upgrading the firmware of 1.5 MB file.
This is an asynchronous API. The response is recieved via sl_net_event_handler_t with SL_NET_OTA_FW_UPDATE_EVENT as event
687
of file components/device/silabs/si91x/wireless/inc/sl_si91x_driver.h
sl_si91x_http_otaf#
sl_status_t sl_si91x_http_otaf (uint8_t type, uint16_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, const uint8_t * post_data, uint32_t post_data_length)
Sends an HTTP request to a specified server URL with optional data and headers, and facilitates firmware downloads from the server.
[in] | type | Valid values are: 2 - HTTP_OTAF |
[in] | flags | Configuration flags. See the table below for details. |
[in] | ip_address | Server IP address. |
[in] | port | Port number. Default: 80 - HTTP, 443 - HTTPS |
[in] | resource | Requested resource URL in string format. |
[in] | host_name |
|
[in] | extended_header | Extended header if present, each header member should end with \r |
[in] | user_name |
|
[in] | password |
|
[in] | post_data |
|
[in] | post_data_length | HTTP data length to be posted to the server. |
This API is non-blocking API. Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
The following table lists the flags that can be used with this function:
Flags | Macro | Description |
---|---|---|
BIT(0) | HTTPS_SUPPORT | Set this bit to enable HTTPS_SUPPORT to use HTTPS feature. |
BIT(1) | IP_VERSION_6 | Set this bit to enable IPv6. By default, it is configured to IPv4. |
BIT(2) | SI91X_TLS_V_1_0 | Set this bit to support SSL TLS Version 1.0 if HTTPS is enabled. |
BIT(3) | SI91X_TLS_V_1_2 | Set this bit to support SSL TLS Version 1.2 if HTTPS is enabled. |
BIT(4) | SI91X_TLS_V_1_1 | Set this bit to support SSL_TLS Version 1.1 if HTTPS is enabled. |
BIT(6) | HTTP_V_1_1 | Set this bit to use HTTP version 1.1 |
BIT(9) | SL_SI91X_HTTPS_CERTIFICATE_INDEX_1 | Set this bit to specify index of SSL cert to be used for HTTPS. |
BIT(10) | SL_SI91X_HTTPS_CERTIFICATE_INDEX_2 | Set this bit to specify index of SSL cert to be used for HTTPS. |
82
of file components/device/silabs/si91x/wireless/firmware_upgrade/firmware_upgradation.h