3
votes

iBeacon specifications says:

The UUID, major and minor values provide the identifying information for the iBeacon.

Major and minor values are used to distinguish products or elements within a region. The Apple documentation is quiet clear on how to do it and the store example is quiet good.

However all this works well only when there is one element category per region (or sub-region) but it doesn't work well if we want the APP to be able to distinguish among elements with the same minor and major within the same region.

Is there some other unique identifier associated to an iBeacon that can be monitored/detected so that I can distinguish iBeacons with the same minor and major value?


EDIT: Additional information

To test this I have created two iBeacons with the same UUID and same major and minor value and then started monitoring for the iBeacons within the UUID that I specified.

The callback code that I have implemented for iBeacons ranged in the regions is the following:

-(void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region {

    NSLog(@"Did range %lu beacon in region %@", (unsigned long)[beacons count], region.identifier);

    for (int i=0; i<[beacons count]; i++) {
        CLBeacon *beacon = [beacons objectAtIndex:i]; 
        // <- breakpoint!
        NSString *_cnt = [[NSString alloc] initWithFormat:@"Number of beacons is : %lu and the current one %i is %f away from you %@",(unsigned long)[beacons count], i, beacon.accuracy, beacon.description];
        }
   }

When I add a breakpoint to the beacon line I see that both CLBeacon objects detected have the same information:

CLBeacon (uuid:<__NSConcreteUUID 0x17003d8e0> 74278BDA-B644-4520-8F0C-720EAF059935, major:20, minor:0, proximity:1 +/- 0.17m, rssi:-42)
CLBeacon (uuid:<__NSConcreteUUID 0x17003e840> 74278BDA-B644-4520-8F0C-720EAF059935, major:20, minor:0, proximity:2 +/- 0.28m, rssi:-47)

So as of now I am unable to distinguish among them unless I specify a major and minor value.

Here is the screenshot of the App I am using to configure the iBeacons (there are no other fields that I can configure):

enter image description here

I wonder if within the blue tooth signal there is some sort of unique identifier that identifies each hardware.

3

3 Answers

6
votes

This is actually a common problem, and it is difficult to solve. While best practices usually say that different beacons should not share the same ProximityUUID/major/minor, there are sometimes legitimate edge cases where multiple beacons are transmitting the same identifiers in the same place. (At Radius Networks, for example, we put default identifiers into our beacons, so if you order two of them they will initially have identical identifiers until you change them.)

Using CoreLocation APIs, two different beacons with the same identifiers will show up as two beacons in the didRangeBeacons:InRegion: callback. This is because internally, iOS maintains uniqueness using the hardware address. Unfortunately, CoreLocation does not expose the hardware mac address or any other indication of which beacon with the same identifier is which.

Using CoreBluetooth APIs in the foreground, you can get callbacks for each iBeacon seen. And while you cannot get their hardware mac address, iOS does assign a unique identifier to each of them (probably based on a hash of the mac address) so you can tell them apart. Unfortunately, iOS does not let you read the contents of the advertisement using CoreBluetooth so you can't read the iBeacon identifiers. All you can really do is count how many different Bluetooth LE are around that might or might not be iBeacons.

It is possible to do some hacky tricks to try and correlate the information from CoreBluetooth and CoreLocation by using timestamps of when devices appeared and their RSSI readings. But these tricks are not extremely reliable and prone to failure when many beacons are around.

3
votes

The - combination between UUID, major and minor should be unique. There shouldn't be two beacons with the same combination, this is the beacon identifier!

1
votes

Your statement that you want "to be able to distinguish among elements with the same minor and major within the same region" doesn't make sense, as the combination of UUID, major and minor is the most specific you can get.

You can have multiple beacons with the same UUID/major/minor if you need to get greater geographical coverage, but these beacons will be indistinguishable from one-another.

How you apply meaning to major and minor values is entirely up to you - If you need to distinguish two locations then simply apply different minor values.