meetsSpecification not working with all ibeacons
See original GitHub issueHello,
I am currently using 4 beacons supplied by Kontakt, (2 Pro and 2 standard).
The beacons (Pro), doesn’t meet the specification of IBeaconAdvertisingPacket class.
I am getting different values of EXPECTED_TYPE and EXPECTED_BEACON_TYPE for the pro type of beacon. I don’t know if Kontakt change something in these beacons or not.
I used also (aruba, estimote, averos, standard kontakt) and every beacon worked fine except the Kontakt pro beacon.
I guess the problem that some companies who provide beacons, change some bits from the advertising packets to add like battery life, led and sensors. So we cannot just test the ibeacon if it meets specification in a static way.
public static boolean meetsSpecification(byte[] data) {
if (data == null || data.length < 29) {
return false;
}
if (getTypeBytes(data) != EXPECTED_TYPE) {
return false;
}
if (!Arrays.equals(getFlagsBytes(data), EXPECTED_FLAGS)) {
return false;
}
if (!Arrays.equals(getBeaconTypeBytes(data), EXPECTED_BEACON_TYPE)) {
return false;
}
return true;
}
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
My iBeacon isn't working - troubleshooting for iBeacons
Your iBeacon is missing trips or not recording any? You can't connect your iBeacon in the app? Below are some troubleshooting tips you...
Read more >iOS 9 is not detecting the iBeacons | Apple Developer Forums
Hi All, Im working on a iBeacon concept where in i detect the beacons and perfom action based on its detection. My code...
Read more >Search for all iBeacons and not just with specific UUID
An iBeacon is a region, and has as defining property the UUID. Therefore, you can only search for the ones matching a UUID....
Read more >Challenges and Tips While Dealing With iBeacon Development
Frequency Issues. As all Beacons do not have the same frequency and do not transmit similar signals of same power, It presents a...
Read more >Beacon FAQ - Echoes xyz
What are beacons? Beacons. Beacons, or iBeacons, are small electronic devices ... you will need to tweak the settings or work out whey...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, I did notice that. The difference is the length of the advertising data from the Kontakt Pro beacon, which makes it not compliant with the iBeacon specification (see the table from my last comment).
I’ve adjusted the check in PR #83 to tolerate changes in byte 4 (
EXPECTED_TYPE). Make sure to change your dependency tocompile 'com.github.neXenio:BLE-Indoor-Positioning:dev-SNAPSHOT'in order to get the changes.I wouldn’t consider the advertising data from your Kontakt Pro beacon to be an iBeacon frame. According to Apple’s specification:
However, you can create your own classes for your use case, e.g.
KontaktProAdvertisingPacket extends AdvertisingPacketandKontaktProBeacon<P extends KontaktProAdvertisingPacket> extends Beacon<P>. Have a look at theAdvertisingPacketFactoryTestandBeaconFactoryTestto see how you can use your own classes.