Hi teams,
I questioned for doing separated scan in MESH application, as the below thread.
but when I called ble_gap_scan_start() and get BLE events with ble_get_event() in separate task, console says another scan was already running, and not only BLE_EVT_GAP_ADV_REPORT/BLE_EVT_GAP_SCAN_COMPLETED, but other events also be received in the same task.
And eventually, MESH application did not work.
How can I separate BLE event handling among multiple tasks?
Device:
Hi firebird.
I assume that you are working on ble_mesh project. Otherwise, please indicate where you are working on. Since you have modified it, can you please share what modifications we have done and which your requirement is? Have you added a custom task?
Thanks, PM_Dialog
Hi,
Yes, I am using ble_mesh example with MESH SDK 1.6.1.
I added the following task and started it after device has been provisioned.
Currently, this task just start another scan and check RSSI strength. I will add some codes for identifing specific devices later.
Hi firebird,
Can you please run your code in debug mode? Does it get stuck anywhere?
Thanks, PM_Dialog
This code runs for a while and randomly stuck.
Every time it stuck, the position is different, so can't figure out the cause.
And some events like BLE_EVT_GAP_ADV_COMPLETED, which is not intended to receive (related with MESH function) was received.
I want to know the followings:
1. Is this approach correct? i.e. Can I get BLE events in multiple tasks without affecting each other?
2. If so, can you please review my code and advice what is wrong.
3.如果没有,回到最初的问题,如何I execute separate scan in MESH application?
Any update?