Question

When a central, on iPad, scans and detects a peripheral, how can it read the Bluetooth LE address of the peripheral?

The CBPeripheral class does not have a property for 'address'.

Était-ce utile?

La solution

For privacy reasons the Bluetooth Address is hidden as a "UUID" (or NSUUID)

https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheral_Class/translated_content/CBPeripheral.html#//apple_ref/occ/instp/CBPeripheral/identifier

If you really need to know a constant bluetooth address of a peripheral then program it into one of its characteristics or into the advertisement package as part of your unique manufacturer data field.

This require of course that you have asked BT SIG for a manufacturer id (and that you are the "manufacturer" of the peripheral) and that the peripheral uses Static Bluetooth address.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top