Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search for all iBeacons and not just with specific UUID

Tags:

Is it possible to search for all iBeacons which are nearby? I know it's possible to search iBeacons by UUID. But i want to find all iBeacons nearby.

like image 412
Christian Avatar asked Sep 13 '13 10:09

Christian


People also ask

Can multiple beacons have same UUID?

No, the API does not work that way.

What is proximity UUID?

The proximity UUID (Universally Unique IDentifier, UUID for short), Major, and Minor parameters – together make up your iBeacon's unique identifier, and are the key components of all advertising packets continually transmitted by your iBeacons.


2 Answers

An iBeacon is a region, and has as defining property the UUID. Therefore, you can only search for the ones matching a UUID. After you find one or more with a specific UUID, you can figure out which is closest using the delegate callbacks, where the beacons are stored in an array ordered by distance.

There is great sample code on this and also a pretty detailed WWDC video session: "What's new in Core Location"

like image 148
Joride Avatar answered Oct 02 '22 15:10

Joride


iBeacons are higher-level constructs than regular BLE peripherals. From what can be determined from the Apple docs, beacons are tied to their service UUID. i.e., a family of beacons is a "region" and a you go into and out of a region based on the range and visibility of a beacon to YOU, not the other way around. Unfortunately Apple has used the term region, which most of us probably associate with MapKit, so this is adding to the general confusion

Here's the bad news: You can only scan for ProximityUUIDs that you know, there is no "wildcard" proximityUUID. Additionally, CLBeacons don't expose the much in the way of lower level CoreBluetooth guts so if you want to find all beacons that happen to be near you, you'll have to use CoreBluetooth, scan for peripherals, then look though the returned peripheries and query each one them to find beacons. Of course Apple has neither registered (with the Bluetooth SIG) or (yet) published the iBeacon characteristics so, you'll need a BT sniffer to reverse engineer what constitutes an iBeacon from any other BLE device.

like image 30
dhmspector Avatar answered Oct 02 '22 14:10

dhmspector