- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello All!
I have a really basic question on how I can continuously scan for BLE packets. There seems to be two APIs - observe and scan, and I have been able to use them as console commands to scan for packets. I tried spinning a new thread and enclosed the scan/observe call in a while 1 loop but that doesn't actually seem right. what is the right way to continually scan for BLE packets?
For example, this didn't work for me:
while ( 1 )
{
wiced_result_t scan_result;
do {
scan_result = wiced_bt_ble_scan(BTM_BLE_SCAN_TYPE_HIGH_DUTY, WICED_TRUE, (wiced_bt_ble_scan_result_cback_t *) hello_sensor_scan_ble_callback);
} while (scan_result != WICED_BT_BUSY);
// wiced_bt_ble_scan(BTM_BLE_SCAN_TYPE_HIGH_DUTY, WICED_TRUE, (wiced_bt_ble_scan_result_cback_t *) hello_sensor_scan_ble_callback);
}
Thanks!
Solved! Go to Solution.
- Labels:
-
Wifi+Bluetooth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use wiced_bt_ble_observe API with the duration set to zero.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess a follow-up question would be how to stop it once the infinite scan has started?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
vmore_3321141 wrote:
I guess a follow-up question would be how to stop it once the infinite scan has started?
Have you tested stop it by wiced_bt_ble_observe(WICED_FALSE,...)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I tried that. It worked