Closed Rayen-cherni closed 3 years ago
Both local name and name are nullable, they may not exist on a peripheral.
So how can i get device's names ?
You check those two fields. If your device is certain to have a name, it will be on one of those. If the device doesn't have a name, then it doesn't have a name, nothing you could do about it.
I have a flutter application where I need to use Bluetooth Low Energy using this Library and I need to check the name of other devices: Library : https://pub.dev/packages/flutter_ble_lib Code :
...
ScanResult scanResult
...
print("Scanned Peripheral ${scanResult.peripheral.name}")
Result : Scanned Peripheral null