apache / mynewt-nimble

Apache mynewt
https://mynewt.apache.org/
Apache License 2.0
664 stars 384 forks source link

Example of starting and stopping ble #1306

Open alberk8 opened 1 year ago

alberk8 commented 1 year ago

Is there any example of ble server/peripheral where the ble is stated, broadcast for a duration eg 90 seconds, then disposed/shutdown ble. Wait for 5 minutes create start broadcast again in this cycle.

alberk8 commented 1 year ago

Can someone please take a look at this implementation, it looks like the deinit does not release the TaskHandle_t host_task_h nimble_port_freertos_deinit()

Calling the nimble_port_freertos_deinit() again will crash the system.

bvdberg commented 1 year ago

You should set host_task_h to NULL inside the if statement. But Nimble also uses Timers and possibly a 2nd Task to run, so you should stop those as well.