using the ibeacon examples in mt7697 (native sdk), I made a simple code example below, I an unable to turn bluetooth on and off continuously, eventually the system will deadlock. Deadlock occurs between a few minutes up to 24hours from start time and always occurs at bt_power_on. And once, even though I have the watchdog disabled, instead of deadlock I saw the system re-init itself repeatedly.
The bluetooth is drawing a lot of milliamps when on, and I need to conserve battery, so I power off bluetooth most of the time, and only power on when I need to advertise.
pablos I see you are the expert here, do you have any idea how to resolve or what the issue is?
bt_status_t app_bt_event_callback(bt_msg_type_t msg, bt_status_t status, void *buff)
bt_gap_le_set_random_address((bt_bd_addr_ptr_t)local_public_addr);// set random address before advertising
//just broadcasted, turn off radio in 100ms
//in 3 sec turn on radio and broadcast again
bt_power_on(local_public_addr,NULL);//<-- deadlock occurs here after 15min to 24hours