question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

meetsSpecification not working with all ibeacons

See original GitHub issue

Hello,

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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Steppschuhcommented, Jun 11, 2018

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).

1reaction
Steppschuhcommented, Jun 11, 2018

I’ve adjusted the check in PR #83 to tolerate changes in byte 4 (EXPECTED_TYPE). Make sure to change your dependency to compile '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:

Bytes Description
09-24 Proximity UUID
25-26 Major
27-28 Minor
29 Signal Power

However, you can create your own classes for your use case, e.g. KontaktProAdvertisingPacket extends AdvertisingPacket and KontaktProBeacon<P extends KontaktProAdvertisingPacket> extends Beacon<P>. Have a look at the AdvertisingPacketFactoryTest and BeaconFactoryTest to see how you can use your own classes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found