0
votes

I would like to create an ‘official’ randomized UUID in my application, before/instead of IOS’s CoreBluetooth library receiving an iBeacon packet from an actual iBeacon device and generating a randomized UUID at that time.

Let me explain. CoreBluetooth, when it receives an iBeacon packet, will create a randomly generated UUID that it will use to associate to a specific iBeacon device. Using CoreBluetooth, developers have NO access to the actual UUID, Major/Minor, TX Power, or MAC address of the advertising iBeacon device, they only have access to the IOS randomly generated UUID. IOS uses the MAC address of the iBeacon as its unique identifier to generate the random UUID, not the broadcasted iBeacon’s UUID. In testing, I’ve changed the UUID of an iBeacon a few times, and when I transmit the advertising packet, IOS still reads it as the same iBeacon. But, when I change the MAC address of the iBeacon, IOS perceives it as a different iBeacon. The IOS randomly generated UUID is persistent between applications running on the IOS device until the device is rebooted.

I use the word ‘official’ because, although it seems I can generate UUID’s with specific functions in the CoreBluetooth library using UUIDWithString, UUIDWithData, UUIDWthNSUUID,

https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBUUID_Class/index.html

I would like to make sure I’m creating THE random UUID that IOS will register and properly associate with that iBeacon.

The IOS CoreBluetooth process I’m trying to accomplish myself typically runs the first time IOS receives a specific iBeacon’s advertisement. My plan is to preempt this so that the first time it receives a packet from that iBeacon, the IOS device already has its random UUID generated and associated with that iBeacon. My application will contain a list of MAC addresses to generate these random UUIDs from.

1
I'm not sure I understand what you're trying to accomplish. You can't force iOS to use a given UUID for a Bluetooth peripheral. Are you worried about security? You don't need to—the peripheral UUID will be different on each and every iOS device discovering the beacon, so there's no way to globally identify a beacon via the peripheral UUID.heypiotr
I'm not so much concerned with security. I would like my application to perform different actions depending on which iBeacon it receive an advertisement package from. Right now and I can't seem to send any kind of unique identifier out from each iBeacon that CoreBluetooth gives me access to. My thought was if each IOS device knew which iBeacon MAC Addresses to look out for, I'd be able to accomplish what I need. I don't need to force a specific UUID, I just need to identify which iBeacon it's detecting. Any other direction is appreciated on this as well.A. Wylie - DigiCoyote
Ah, got it. Yes, you won't see the identifier via Core Bluetooth, iOS filters that out. Have you considered using Core Location instead? Alternatively, use Eddystone-UID, this one is available via Core Bluetooth. Most beacons from the prominent vendors can be switched to broadcast Eddystone instead of iBeacon, so you shouldn't need to buy new hardware.heypiotr
If Eddystone uses CoreBluetooth, then it wouldn't be limited by the 1 second interval that CoreLocation imposes, correct?A. Wylie - DigiCoyote
Correct, Core Bluetooth in the foreground should give you every single discovered packet, so it's only limited by the advertising frequency of your beacon, and the environmental conditions (which affect how many packets get lost on the way).heypiotr

1 Answers

1
votes

Unfortunately, I do not think this is possible. As you say, the UUID assigned to a detected Bluetooth LE device is internally generated by CoreBluetooth. There is no public API to alter its behavior in this regard.