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

Method didDiscoverDevice returns Bluetooth MAC address instead of name #51

Closed
PeterKucera opened this issue Aug 26, 2020 · 2 comments
Closed

Comments

@PeterKucera
Copy link

Steps to reproduce

In method didDiscoverDevice, bluetoothPeripherial.name contains instead of string value with device name only MAC address of that given device.

Expected
I/BlueFalcon: Discovered device : DeviceNameXY

Actual
I/BlueFalcon: Discovered device : 46:95:8F:86:74:A0

Additional info
Device - Samsung XCover Pro
OS version - Android 10
Library version - "dev.bluefalcon:library:0.7.2"

Anyone else experienced similar issue before?

Note:
This could be also an Android issue, because sometimes when I am trying to pair a new device in a place where are too many of advertising Bluetooth devices at the same time, even default system settings app couldn't read device names, and shows just MAC addresses.

@PeterKucera
Copy link
Author

Now I see what causes this behaviour, if device name is null, device address is returned instead,

From class BluetoothPeripheral:

actual val name: String? get() = bluetoothDevice.name ?: bluetoothDevice.address

@Reedyuk
Copy link
Owner

Reedyuk commented Aug 26, 2020

Yep its intentional to ensure something is returned, as apposed to nothing.

@Reedyuk Reedyuk closed this as completed Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants