2

Is there any Flutter package available that can listen for Eddystone UID beacons and Eddystone-URLs?

I have been looking at various packages such as beacons_plugin and flutter_beacon but I cannot seem to find any package that can receive these beacon broadcasts.

Has anyone been able to achieve this? If so, how?

Thank's @ukBaz - I am now seeing the Eddystone data. However i am trying to get the namespace id and instance data from the device.

I am using a Minew D15N BLE beacon and printing out the data..

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]

I sometimes also receive this..

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]

Based on this documentation (not sure if this is right) I was trying this..

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

But get this following error..

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

Here is a screen shot of the UID slot that i have setup to test.. enter image description here

teh_raab
  • 384
  • 1
  • 3
  • 21

1 Answers1

3

Those packages look like they are just for iBeacon which uses manufacturer data in the advertising packet. For Eddystone it uses service data. The flutter_blue library give you access to the service data. https://pub.dev/documentation/flutter_blue/latest/flutter_blue/AdvertisementData-class.html

The following answer shows how to scan and access the advertising data with flutter_blue: https://stackoverflow.com/a/63591662/7721752

ukBaz
  • 6,985
  • 2
  • 8
  • 31
  • Thank you - I am now seeing the Eddystone data with Flutter Blue. Just looking at your previous responses to the other question and using your example, I am trying to get the UID Namespace ID and Instance and using the dartpad example unable to get it. I've updated the the question above with the data I am getting back - any chance you can see where I am going wrong! – teh_raab Apr 24 '21 at 12:47
  • 1
    It is the serviceData that you need to get bytes 2-11 for, not the manufacturerData. `[113, 28, 115, 246, 74, 253, 206, 7, 183, 227]` is your namesapce of `711c73f64afdce07b7e3`. The Eddystone service is `0000feaa-0000-1000-8000-00805f9b34fb` or `feaa` for short. – ukBaz Apr 24 '21 at 19:41
  • Thank you - this was exactly what I was after – teh_raab Apr 26 '21 at 08:13