Web bluetooth get name from scan
Reported by
thea...@gmail.com,
Nov 6
|
|||||
Issue description
Chrome Version : 70.0.3538.77
OS Version: 10.0
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari: fail
Firefox: fail
IE/Edge: fail
What steps will reproduce the problem?
1. search for a bluetooth device that sends his name in the scan response
2. chrome won't be able to detect it and return name as "Unknown or unsupported device"
What is the expected result?
Chrome should be able detect the name from the scan response and attach it to the device list
What happens instead of that?
Chrome writes the device is unknown or unsupported
Please provide any additional information below. Attach a screenshot if
possible.
The website I have should connect to a ble device i'm working with, my code was originally written on a mac computer and everything was fine including the name filter in which I put my device name.
But in windows on the same website, chrome doesn't get the device name and I can't use the name filter anymore.
Windows picture: https://gyazo.com/6dba858168241e0f5d0a23914cdeca8b
Mac picture: https://gyazo.com/79c1e981914e4429739dc089a9c0d020
As you can see in the mac picture chrome does get the name but in the windows it just says unknown or unsupported device.
The same code runs on both sites but on the mac one I use the name filter and in the windows one I removed it.
UserAgentString: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
,
Nov 6
This is happening because we only use the name in the first advertisement we receive[1]. We should be updating the name every time we receive an advertisement. [1] https://cs.chromium.org/chromium/src/device/bluetooth/bluetooth_adapter_winrt.cc?g=0&l=1148
,
Nov 6
,
Nov 7
,
Nov 8
Thanks guys for reporting this, I was about to do so! To add to Giovanni's comment, we also need to ensure we perform active scanning, because device name updates come from scan response. But that is already the case: https://cs.chromium.org/chromium/src/device/bluetooth/bluetooth_adapter_winrt.cc?g=0&l=713
,
Nov 9
Also guys, please notice that if you filter on device name (or name prefix), then no device shows up in chooser.
,
Nov 14
,
Nov 16
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b73f5dba8ac4a67f557a6e85b16118439cb0d66b commit b73f5dba8ac4a67f557a6e85b16118439cb0d66b Author: Reilly Grant <reillyg@chromium.org> Date: Fri Nov 16 06:57:22 2018 [Bluetooth][WinRT] Track device name changes This change adds support for tracking device name changes in the WinRT Bluetooth Low Energy backend. This is done in two ways: * When advertisement packets are received for a known device the "local name" is updated if previous advertisements did not provide one. * BluetoothDeviceWinrt subscribes to the NameChanged event on the IBluetoothLEDevice. This tracks name changes once a connection is established. Bug: 902241 Change-Id: I489fc1b7fb86da3c28fde1ec4459d0c736f27326 Reviewed-on: https://chromium-review.googlesource.com/c/1328222 Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org> Commit-Queue: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#608686} [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/bluetooth_adapter.h [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/bluetooth_adapter_winrt.cc [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/bluetooth_adapter_winrt.h [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/bluetooth_device_unittest.cc [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/bluetooth_device_winrt.cc [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/bluetooth_device_winrt.h [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/test/bluetooth_test.h [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/test/bluetooth_test_win.cc [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/test/bluetooth_test_win.h [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/test/fake_bluetooth_le_device_winrt.cc [modify] https://crrev.com/b73f5dba8ac4a67f557a6e85b16118439cb0d66b/device/bluetooth/test/fake_bluetooth_le_device_winrt.h
,
Nov 16
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Nov 6