OTA#
OTA.
Functions | |
sl_status_t | sl_bt_ota_set_device_name (size_t name_len, const uint8_t *name) |
sl_status_t | sl_bt_ota_set_advertising_data (uint8_t packet_type, size_t adv_data_len, const uint8_t *adv_data) |
sl_status_t | sl_bt_ota_set_configuration (uint32_t flags) |
sl_status_t | sl_bt_ota_set_rf_path (uint8_t enable, uint8_t antenna) |
Detailed Description#
OTA.
Commands in this class are used for configuring OTA DFU using the Apploader.
Note that this class is used on EFR series 1 and is not available for series 2 devices. The Apploader runs as a Bootloader communication plugin on series 2 and the Apploader plugin API supports setting device name and advertising data. Other configurations can be implemented in the Apploader plugin application space.
Function Documentation#
◆sl_bt_ota_set_device_name()#
sl_status_t sl_bt_ota_set_device_name | ( | size_t |
|
const uint8_t * |
| ||
) |
Set the device name to be used during the OTA update. The name is stored in the persistent store. Maximum name length is 17 bytes.
Default is "OTA" if a name is not set.
Note that this command is available for EFR series 1 devices only.
Parameters
[in] |
| Length of data in |
[in] |
| OTA device name |
ReturnsSL_STATUS_OK if successful. Error code otherwise.
◆sl_bt_ota_set_advertising_data()#
sl_status_t sl_bt_ota_set_advertising_data | ( | uint8_t |
|
size_t |
| ||
const uint8_t * |
| ||
) |
Set advertising packets in OTA. Maximum 31 bytes of data can be set.
Note that this command is available for EFR series 1 devices only.
Parameters
[in] |
| This value selects whether data is intended for advertising packets or scan response packets.* 2: OTA advertising packets |
4: OTA scan response packets | | [in] |
adv_data_len
| Length of data inadv_data
| | [in] |adv_data
| Data to be set |
ReturnsSL_STATUS_OK if successful. Error code otherwise.
◆sl_bt_ota_set_configuration()#
sl_status_t sl_bt_ota_set_configuration | ( | uint32_t |
| ) |
Set OTA configuration. The setting is stored in the persistent store.
Note that this command is available for EFR series 1 devices only.
Parameters
[in] |
| OTA configuration flags. This value is given as a bitmask. Flags: |
Bit 0: Advertising address* 0: Use public device address |
1: Use a random address
Bit 1: Application update version check. Check the version number and product ID of the application upgrade before applying. If the version number of the current application can not be determined, this implementation will assume that it is OK to apply the new image. Note that this is not a security feature.* 0: Disable version check
1: Enable version check
Bit 2 to 31: Reserved Default value: 0 |
ReturnsSL_STATUS_OK if successful. Error code otherwise.
◆sl_bt_ota_set_rf_path()#
sl_status_t sl_bt_ota_set_rf_path | ( | uint8_t |
|
uint8_t |
| ||
) |
Set RF path antenna for OTA. This command should be used only if the device has multiple antenna ports. The setting is stored in the persistent store.
Note that this command is available for EFR series 1 devices only.
Parameters
[in] |
| If enabled antenna selection is used in OTA, otherwise default antenna is used. |
[in] |
| Set antenna used in OTA. Value should be come from RAIL_AntennaSel_t enum. See antenna path selection in RAIL rail_chip_specific.h. |
ReturnsSL_STATUS_OK if successful. Error code otherwise.