pwittchen / ReactiveBeacons

Android library scanning BLE beacons nearby with RxJava
Apache License 2.0
167 stars 38 forks source link

iBeacon UUID and Eddystone UID #54

Open doubl3p opened 7 years ago

doubl3p commented 7 years ago

where can i get:

It would be very helpful.

pwittchen commented 7 years ago

You can try this method:

ParcelUuid[] uuids = beacon.device.getUuids();

Beacon class has public final device field of type BluetoothDevice.

Reference in Android SDK documentation: https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getUuids()

doubl3p commented 7 years ago

thanks for the fast reply. sadly it's not what i am searching for:

ParcelUuid[] uuids = beacon.device.getUuids(); don't returns the:

and let my application terminate.

beacon.device.toString(); also retuns just the MAC-Address.

pwittchen commented 7 years ago

After the quick search, I found out that it's not possible to get iBeacon UUID and Eddystone UID just with Android SDK easily. Probably it could be somehow extracted or translated from uuids or scanRecord field in Beacon class. Unfortunately, I don't know how to do that yet. I suppose it may be a custom functionality, which require additional implementation. When I gather more concrete knowledge in this topic, I'll post an update here.

I'm also open for help and suggestions of the other people.

doubl3p commented 7 years ago

here in this lib:
https://altbeacon.github.io/android-beacon-library/distance-triggering.html they define a BeaconManager and use BeaconParser to define how to parse the Advertising packet. here e.g. iBeacon format.

beaconManager = BeaconManager.getInstanceForApplication(this); beaconManager.getBeaconParsers().add(new BeaconParser() .setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24")); beaconManager.bind(this);

pwittchen commented 7 years ago

Initial references (code snippets), which can help in the implementation:

iBeacon:

https://github.com/inthepocket/ibeacon-scanner-android/blob/32e286cd67bfd97255f62f5d470db67921877c34/ibeaconscanner/src/main/java/mobi/inthepocket/android/beacons/ibeaconscanner/ScannerScanCallback.java

Eddystone:

https://github.com/google/eddystone/blob/master/tools/gatt-config/android/BeaconConfig/app/src/main/java/com/github/google/beaconfig/BeaconScanData.java