Reputation: 129
I am using nRF connect Apk for set Major and Minor. Always beacon is disconnect and it stop sending Major and Minor. I was try many apps but same condition arrives. Please suggest me what i will do.
Upvotes: 0
Views: 63
Reputation: 129
Step 1:First check your beacon is ibeacon or not Step 2:If your beacon is not ibeacon than make it ibeacon first by using nRFConnect app. Step 3:By using nRFConnect app you make your beacon in ibeacon after making ibeacon you use following code to get Major,Minor and UUID of beacon
List<ADStructure> structures = ADPayloadParser.getInstance().parse(scanRecord);
for (ADStructure structure : structures) {
String majorvalue= bytesToHex(structure.getData());
if (structure instanceof IBeacon) {
IBeacon iBeacon = (IBeacon) structure;
UUID uuidvalue = iBeacon.getUUID();
uuid=uuidvalue.toString();
major = String.valueOf(iBeacon.getMajor());
minor = String.valueOf(iBeacon.getMinor());
}
}
https://github.com/TakahikoKawasaki/nv-bluetooth
Upvotes: 3