r/iOSProgramming • u/bigMOTOR • Dec 03 '19
Question Does someone know how to catch opening of AirPods case event with IOBluetooth?
/r/macosprogramming/comments/e57bca/does_someone_know_how_to_catch_opening_of_airpods/
14
Upvotes
4
u/SirensToGo Objective-C / Swift Dec 03 '19
The AirPods open advertisement can be recreated as shown here
https://github.com/hexway/apple_bleee/blob/master/adv_airpods.py
How to capture this advertisement is another story but it’s at least fully standard BTLE
2
u/gormster Dec 03 '19
I think there might be a teeny tiny possibility it’s not standard Bluetooth. I remember apple saying that it was Bluetooth with a sprinkling of nonstandard fairy dust.
1
u/oflannabhra Dec 03 '19
You probably won’t find it with IOBluetooth.
I don’t think the case opening event is a full peripheral connection. It could be an advertisement event. I’d start there.
Advertisements can carry a tiny bit of data with them. Apple might be encoding info within that portion of the advertisement.
If it is outside of the Bluetooth spec, though, IOBluetooth won’t be of help. You’ll need to hook into system events, most likely.