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 for configuring OTA DFU.
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.
Parameters
[in]| `name_len`| Length of data in `name`
---|---|---
[in]| name
| OTA device name
Returns
SL_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.
Parameters
[in]| `packet_type`| 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 in adv_data
[in]| adv_data
| Data to be set
Returns
SL_STATUS_OK if successful. Error code otherwise.
◆ sl_bt_ota_set_configuration()#
sl_status_t sl_bt_ota_set_configuration | ( | uint32_t | flags
| ) |
---|---|---|---|---|---
Set OTA configuration. The setting is stored in the persistent store.
Parameters
[in]| `flags`|
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
---|---|---
Returns
SL_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. Should be used only if device has multiple antenna ports. The setting is stored in the persistent store.
Parameters
[in]| `enable`| If enabled antenna selection is used in OTA, otherwise default antenna is used.
---|---|---
[in]| antenna
| Set antenna used in OTA. Value should be come from
RAIL_AntennaSel_t enum. See antenna path selection in RAIL
rail_chip_specific.h.
Returns
SL_STATUS_OK if successful. Error code otherwise.