I am working on an iPhone and Mac OS X application that allows you to lock and unlock your Mac through proximity. It means that if the signal level is below a certain threshold or the connection is lost, it blocks the macro.
I work with the Apples CoreBluetooth base for BTLE, using the iPhone as a peripheral and the Mac as a central one. So far, so good. It is also very good, but when I send the app to the background on the iPhone, the ads seem to change. The iPhone still advertises, but without the service profile and features that I use in the application. Although this is not a problem when the iPhone is still in range of the Mac, since it is still connected and the features are not used in the center, it becomes a problem after the iPhone leaves the range. As expected, the Mac locks and starts detecting to reconnect the iPhone and unlock if it succeeds.
But in this discovery, I use the specified service profile and features to get only the devices that launch my application and identify the one that opens to unlock.
I tried a workaround, opening without a service profile and determining the correct device through my UUID, which I saved when I started using this iPhone to lock and unlock. This workaround also works in a small amount, because when I turn off Bluetooth on the iPhone and turn it on again, it gets a different UUID. This is a limitation with which I could live, but it also changes the UUID after a few hours, and then the unlock does not work.
Perhaps someone has already worked on a similar application and knows how to fix such a problem? Or do you know the static value that I can use to identify the device?
kober source share