Flutter Eddystone 信标检测

Flutter Eddystone beacon detection

是否有可用的 Flutter 包可以侦听 Eddystone UID 信标和 Ed​​dystone-URL?

我一直在查看各种包,例如 beacons_plugin and flutter_beacon,但我似乎找不到任何可以接收这些信标广播的包。

有没有人能做到这一点?如果是,怎么做?

谢谢@ukBaz - 我现在看到了 Eddystone 数据。但是我正在尝试从设备获取命名空间 ID 和实例数据。

我正在使用 Minew D15N BLE 信标并打印出数据..

I/flutter (27645): device id: AC:23:3F:6A:FE:85, name: , type: BluetoothDeviceType.le found! rssi: -68
I/flutter (27645): advertisementData => localName: , txPowerLevel: null, connectable: false
I/flutter (27645): advertisementData -> serviceUuids length: 1
I/flutter (27645):      0000feaa-0000-1000-8000-00805f9b34fb
I/flutter (27645): advertisementData -> manufacturerData length: 0
I/flutter (27645): advertisementData -> serviceData length: 1
I/flutter (27645): 0000feaa-0000-1000-8000-00805f9b34fb: [0, 232, 113, 28, 115, 246, 74, 253, 206, 7, 183, 227, 153, 153, 153, 153, 153, 153]

我有时也会收到这个..

advertisementData -> manufacturerData length: 1
I/flutter (27645): 76: [2, 21, 144, 156, 60, 249, 252, 92, 72, 65, 182, 149, 56, 9, 88, 165, 26, 90, 234, 95, 39, 15, 204]

基于这个documentation(不确定这是否正确)我正在尝试这个..

var naaa = ByteData.sublistView(manufacturerData, 2, 11);

但是出现以下错误..

Uncaught Error: TypeError: null: type 'JSNull' is not a subtype of type 'List<int>'

这是我设置用于测试的 UID 插槽的屏幕截图。

这些包看起来只适用于在广告包中使用制造商数据的 iBeacon。对于 Eddystone,它使用服务数据。 flutter_blue 库使您可以访问服务数据。 https://pub.dev/documentation/flutter_blue/latest/flutter_blue/AdvertisementData-class.html

以下答案显示了如何使用 flutter_blue 扫描和访问广告数据: