Hi,
Trying to read namespace and instance data from Eddystone Beacon device using “eddystone.namespace” and “eddystone.instance” parameters from Eddystone(com.estimote.coresdk.recognition.packets.Eddystone) object, which is received in the “onEddystonesFound” method.
private BeaconManager beaconManager;
SystemRequirementsChecker.checkWithDefaultDialogs(this);
beaconManager = new BeaconManager(appCntxt);
beaconManager.setEddystoneListener(new BeaconManager.EddystoneListener() {
@Override
public void onEddystonesFound(List eddystones) {
//Toast.makeText(appCntxt, “Eddystones Found”, Toast.LENGTH_SHORT).show();
for (Eddystone eddystone : eddystones) {
if (eddystone.isUid()) {
Toast.makeText(appCntxt, “Eddystone UID Found”, Toast.LENGTH_SHORT).show();
Log.i(TAG, "Namespace: " + eddystone.namespace);
Log.i(TAG, "Instance: " + eddystone.instance);
} else if (eddystone.isUrl()) {
Toast.makeText(appCntxt, “Eddystone URL Found”, Toast.LENGTH_SHORT).show();
Log.i(TAG, "Eddystone: " + eddystone.url);
}
}
}
});
beaconManager.setForegroundScanPeriod(10000, 5000);
beaconManager.connect(new BeaconManager.ServiceReadyCallback() {
@Override
public void onServiceReady() {
Log.i(TAG, “onServiceReady”);
beaconManager.startEddystoneDiscovery();
}
});
Issue with data:
namespace is always skipping first 3 bytes of data(Giving it from 4th byte - compared in other scanner apps) and taking first 3 bytes from “instance” data and appending at the end.
instance is skipping first 3 bytes and adding “000000” at the end.
Please check this and provide the correct way of reading these values, if anything wrong in my code.
Thanks & Regards,
Durga Prasad.