Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes the scan does not return localName and device.name but only device.deviceId #662

Open
emanueletoffolon opened this issue Jul 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@emanueletoffolon
Copy link
Contributor

Describe the bug
Sometimes the scan does not return localName and device.name but only device.deviceId

To Reproduce
Start the scan using requestLEScan with the default options

Smartphone (please complete the following information):

  • Device: some Android phone
  • OS: Android
  • Version: any

Plugin version:

  • @capacitor-community/bluetooth-le:6.0.0

Has this ever happened to you?

Thanks

@emanueletoffolon emanueletoffolon added the bug Something isn't working label Jul 5, 2024
@pwespi
Copy link
Member

pwespi commented Jul 22, 2024

This is expected because not all devices advertise a name.

Do you have a peripheral where you expect a name and don't get one?

@emanueletoffolon
Copy link
Contributor Author

Yes, sometimes the same device returns the name and deviceId and sometimes just the deviceId. I noticed this by keeping track of the deviceId since on Android it corresponds to the Mac address and never changes unlike on iOS. I tried to do several scanning tests with nRF connect and I didn't encounter this problem, so I decided to write here to ask if anyone has had the same problem.

Thanks

@bonatoc
Copy link

bonatoc commented Sep 13, 2024

@emanueletoffolon I have the same problem under Android.
Sometimes it's the ID of the devices, sometimes it's the name (as per BLE GAP).
It's inconsistent and I wonder if this has to do with some caches on the Android part regarding "known devices" (but I'm far from being a specialist).

I'm referring to the Android pop-up listing the found devices after a requestLEScan() call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants