Closed
Bug 1163944
Opened 10 years ago
Closed 10 years ago
[bluetooth2] startLeScan are unstoppable until bluetooth disabled
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1163969
People
(Reporter: elin, Unassigned)
Details
After I called startLeScan,
I found that I'm not able to stop it by calling stopLeScan() (results from stopLeScan are 'reject' or 'pending'),
and not even by stopping the app,
it only stops after bluetooth disabled or reboot.
These are logs that keep popping out:
D/wpa_supplicant( 1027): RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
D/wpa_supplicant( 1027): wlan0: Control interface command 'SIGNAL_POLL'
D/wpa_supplicant( 1027): nl80211: survey data missing!
I/bt-hci ( 209): BLE HCI(id=62) event = 0x02)
I/bt-hci ( 209): btu_ble_process_adv_pkt
I/bt-hci ( 209): BLE HCI(id=62) event = 0x02)
I/bt-hci ( 209): btu_ble_process_adv_pkt
I/bt-hci ( 209): BLE HCI(id=62) event = 0x02)
I/bt-hci ( 209): btu_ble_process_adv_pkt
I/bt-hci ( 209): BLE HCI(id=62) event = 0x02)
I/bt-hci ( 209): btu_ble_process_adv_pkt
I/bt-hci ( 209): BLE HCI(id=62) event = 0x02)
I/bt-hci ( 209): btu_ble_process_adv_pkt
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
stopLeScan works!
but LeScan still keep scanning if I didn't call stopLeScan and stop my app,
is this an intended behavior?
and there're 2 more things to consider in compare to previous discovery implementation:
1. startDiscovery/stopDiscovery would fire onattributechanged event to indicate discovery status,
but startLeScan/stopLeScan won't.
2. startDiscovery will stop automatically after a while, but stopLeScan won't, it just keep scanning until the end of the world XD.
I'm not sure about the pros and cons yet, this is just a recap of my observation.
Flags: needinfo?(jaliu)
Comment 3•10 years ago
|
||
Hi elin,
Thank you for the feedbacks.
> LeScan still keep scanning if I didn't call stopLeScan and stop my app, is this an intended behavior?
If an app doesn't call stopLeScan, Gecko would keep the scan task alive until the app process get killed. If you notice it keeps scanning even when the app process has been killed, please file a bug for it. :)
> 1. startDiscovery/stopDiscovery would fire onattributechanged event to indicate discovery status, but > startLeScan/stopLeScan won't.
Yes, it's true.
Gecko doesn't provide an attribute to indicate scanning status since ...
1) The promise objects of startpLeScan/stopLeScan have similar capability.
2) Unlike 'BT discovery', a adapter can perform multiple scan tasks at the same time.
An app should only concern about the scanning that it triggered. Apps can't and shouldn't know the scanning status which are triggered by other apps.
3) Discovery is a heavy task. It might affect other BT operations if they are performing at the same time. Therefore, Gecko provides a status to let developers know whether it's discovering or not. However, LE scan is much lighter and it wouldn't be a problem.
> 2. startDiscovery will stop automatically after a while, but stopLeScan won't, it just keep scanning > until the end of the world XD.
It seems like a big issue XD. However, it's an expected behavior.
Surprisingly, there are a few scenarios need to keep scanning all the time.
Please refer to https://www.blesh.com/physical-web/
Discovery is a heavy task and it would consume battery power badly. Therefore, Bluetooth stack has to stop it off automatically to prevent it burn off battery power. However, power consumption wouldn't be an issue for low energy scan. It's fine to keep scanning if it's what the app want to dao.
Regards,
Jamin
Flags: needinfo?(jaliu)
Thanks for the explaination,
I created a bug for stopping LeScan when app stops.
You need to log in
before you can comment on or make changes to this bug.
Description
•