Open PierreClaret opened 3 years ago
navigator.bluetooth.requestLEScan(options)
starts scanning for BLE advertisements, asking the user for permission if they haven’t yet granted it. See https://webbluetoothcg.github.io/web-bluetooth/scanning#ref-for-dom-bluetooth-requestlescan%E2%91%A0
watchAdvertisements()
requires you to have a BluetoothDevice first but not necessarily connected. user has to select it firs though. See
https://webbluetoothcg.github.io/web-bluetooth/#ref-for-dom-bluetoothdevice-watchadvertisements%E2%91%A0
Ok thank you ! I'm having trouble to get the Scan demo working I have tried on a Mac and a Windows. On the Mac I got an error message that state "Scan blocked by user" but I have enabled on chrome the experimental web platform. On windows the scan runs without stopping or getting any advertisement but I receive no error message. Would you happen to know why ?
I can see the popup on macOS
Make sure you didn't block "Bluetooth Scanning" by checking the lock browser icon
Do you have nearby Bluetooth devices when scanning around you?
I have the pop up now. Sorry forgot about the lock... But I have no Bluetooth devices. However for the watch advertisement I can see multiple devices is it normal ?
https://bugs.chromium.org/p/chromium/issues/detail?id=1155557#c3 may be the issue you're facing actually.
See if this hack works for you:
navigator.bluetooth.requestDevice({acceptAllDevices: true})
Hi Francois ! I was wondering what the event.Manufacturerdata.forEach does ? Cause I have a tag that sends manufacturer data but when I scan I only got the UUID of the device...
https://webbluetoothcg.github.io/web-bluetooth/#ref-for-dom-bluetoothadvertisingevent-manufacturerdata is a map of manufacturer data broadcasted by the bluetooth device
Hi I am trying to find the difference between the scan and watch advertisement ? Do they both do not need connexion ? I am also trying to find what the watchAdvertisement() function does ? Could anyone help me ?