Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
148
Ver.1.0.0
used for debugging: When OTA fails, user can read the “result”, stop MCU by using
“while(1)”, and find the reason for current OTA failure.
LED indication can be added to indicate OTA success, as shown below:
void
LED_show_ota_result
(
int
result)
{
irq_disable();
WATCHDOG_DISABLE;
gpio_set_output_en(GPIO_LED, 1);
if
(result ==
OTA_SUCCESS
){
//OTA success
gpio_write(GPIO_LED, 1);
sleep_us(2000000);
//led on for 2s
gpio_write(GPIO_LED, 0);
}
else
{
//OTA fail
}
gpio_set_output_en(GPIO_LED, 0);
}
bls_ota_registerResultIndicateCb (LED_show_ota_result);
The otaWrite function in Slave is assembled in lib, other related interfaces are available
in stack/ble/service/ble_ll_ota.h of SDK.