Hi, Dialog Engineers,
I have modify the ble_peripheral sample project to supoort OTA, and I have follow Training-06-suota-example guide and I can connect the device and upload the new img, but when the upload finished, and it promt to reset,and then the device disconnect, but nothing hanppened , it's stiill the old image.
I have done something as follow:
1、add spotar.c and spotar_task.c to the project
2,包括user_modules_config spotar模块.h #define EXCLUDE_DLG_PROXR (0)
3、define profile_callbacks in user_callback_config.h
static const struct profile_callbacks user_profile_callbacks = {
#if (BLE_BAS_SERVER)
.on_batt_level_upd_cfm = NULL,
.on_batt_level_ntf_cfg_ind = NULL,
#endif
#if (BLE_PROX_REPORTER)
.on_proxr_level_upd_ind = default_proxr_level_upd_ind_handler,
.on_proxr_lls_alert_ind = default_proxr_lls_alert_ind_handler,
#endif
#if (BLE_SPOTA_RECEIVER)
.on_spotar_status_change = NULL,
#endif
};
4、include head files in user_profiles_config.h
#include "proxr.h"
#include "spotar.h"
5、add OTA service in advertising content
#define USER_ADVERTISE_DATA ("\x05"\
ADV_TYPE_COMPLETE_LIST_16BIT_SERVICE_IDS\
ADV_UUID_DEVICE_INFORMATION_SERVICE\
ADV_UUID_SPOTAR_SERVICE\
this problem has been fixed,