Closed iBog closed 5 months ago
This is because the peripheral's advertisement didn't contains a local name field, we use this name when discover advertisement, you can try the BluetoothLEAdvertisement sample of Microsoft, it's should have the same behavior(you should comment the watcher's filters code first) If the advertisement contains a local name field, you will see the name when run the example, you can try to run this example with an Android or iOS device which support PeripheralManager api, use the advertiser to advertise an advertisement, then run this example on Windows or other platforms, you can see the name(by default le12138) after scan.
I had this happen to me and like you mentioned the example works.
After some playing around with it, I believe there is a parsing issue. Names with non alpha-numeric characters don't show up.
Works unclebob
doesn't work uncle bob
(also tried variant uncle_bob
which didn't work)
But all variants work on android, and on the windows 'add a device' dialog shown in the images they show up so I don't believe its a 'windows' issue.
Thanks for your report, let me check the code to see how to resolve this issue.
I had this happen to me and like you mentioned the example works.
After some playing around with it, I believe there is a parsing issue. Names with non alpha-numeric characters don't show up.
Works unclebob
doesn't work uncle bob (also tried variant uncle_bob which didn't work)
I tested on windows but can't reproduce this issue.
This issue is stale because it has been open for 30 days with no activity.
I'm still planning on looking into this further just haven't had time
I'm still planning on looking into this further just haven't had time
I tested this a few days before, I believe this is a normal behaivor, you can run the Microsoft samples, it has the same behavior as this plugin.
Notice there are two ways to discover BLE devices on Windows, one way is to use the BluetoothLEAdvertisementWatcher
, another way is to use the DeviceWatcher
class.
The first way which this plugin used can only show the localName defined in the BLE advertisement.
The second way does show the device name but this name is not defined in the BLE advertisement, and use this way we can't get the BLE advertisement and RSSI.
PS: The first way sample from Microsoft is here. You need to comment the Advertisement filters before run this sample.
The second way sample from Microsoft is here.
Good news! I have confirmed that the missed device name is included in the scan response or extended advertisement, which I ignored before, this will be fixed in the next version. Anyone can pull the 6.0.0 branch and run the example in the bluetooth_low_energy_windows to see the difference.
Awesome I'll test that out...sorry I never had time to pursue. Thanks for the great lib.
Fixed in 6.0.0