on BLE scan error
Posted: Mon Aug 16, 2021 4:12 pm
Hi All,
I used a heart rate device (Polar) in my application. It works like this, when the device is not connected I always start a scanning in every 30 secs, until I found the device. It works well, but sometimes I got an error when device came back:
I (77888660) HR_CLIENT: Start bluetooth scanning
W (77888670) BT_APPL: bta_dm_ble_scan start scan failed. status=0x3
After that I cannot reconnect the device I need to restart my application.
I implemented event mechanism like:
but it is never called.
My question is that, how can I detect when something is wrong, and how can I reset the ble subsytem correctly?
thx,
Zamek
I used a heart rate device (Polar) in my application. It works like this, when the device is not connected I always start a scanning in every 30 secs, until I found the device. It works well, but sometimes I got an error when device came back:
I (77888660) HR_CLIENT: Start bluetooth scanning
W (77888670) BT_APPL: bta_dm_ble_scan start scan failed. status=0x3
After that I cannot reconnect the device I need to restart my application.
I implemented event mechanism like:
Code: Select all
...
case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
//scan start complete event to indicate scan start successfully or failed
if (param->scan_start_cmpl.status == ESP_BT_STATUS_SUCCESS)
GAP_LOGD(TAG, "Scan start success");
else {
GAP_LOGD(TAG, "Scan start failed");
}
...
My question is that, how can I detect when something is wrong, and how can I reset the ble subsytem correctly?
thx,
Zamek