I am working with nRF Connect SDK using an nRF52840 DK. And I want to realise both BLE mesh and FOTA upgrade. FOTA upgrade example SMP Server Sample works properly for Bluetooth Low Energy (without any mesh). And now I want to integrate this FOTA upgrade into BLE mesh application. Please, tell me, how can I do it in the best way?
I had some attempts to realise it, however I faced some difficulties. I don't know how to stop mesh advertisement, which started by bt_mesh_prov_enable
, and run ordinary BLE advertising by bt_le_adv_start
. bt_le_adv_stop
and bt_mesh_prov_disable
didn't stop mesh advertisement, since calling bt_le_adv_start
function after them returned EALREADY
error code. As I think, I could merely set a flag to upgrade (after pressing a button or some command) and reboot microcontroller, and depending on this flag run the FOTA upgrade sample. But I think that there's a more straightforward way to realise this functionality. Can you explain to me how to merge BLE mesh example and FOTA upgrade properly?