I have a BLE peripheral that requires a PIN code. I am connecting to this peripheral using Core Bluetooth CBCentralManager on iOS 7.
When I connect to this peripheral, 'didConnectPeripheral' (central delegate) gets called before the PIN code authentication is successfully completed.
iOS only displays the pin code dialog after 'didConnectPeripheral' is called.
I need to start interacting with the peripheral as soon as this PIN code dialog is finished and authentication process is complete. How can I determine when this has happened?
The challenge is to only proceed after the authentication is successful, but:
From the above, I have been unable to determine:
Any help would be appreciated.
From my experience with CoreBluetooth you will not receive any information as to whether you are authorized and when the pin code authorization is completed until you attempt an action that is unauthorized, which will fail with one of three error responses:
InsufficientEncryption
InsufficientAuthentication
InsufficientAuthorization
The peripheral is what determines which error you will be returned. (Technically they are defined by the GATT in BLE 4.X specs but it is all implementation detail controlled on the peripheral side)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.