I am a little confused as to what level the Android or peripheral device requests the bluetooth low energy pair request type. Is this in the application layer when I initiate the connection via device.connectGatt(context, false, gattCallback)
or would this be the job of the peripheral to suggest the type?
How can someone choose between Just Works
, Numeric Comparison
, Passkey Entry
and Out of Band
?
Both devices exchange their IOCapabilities at the beginning of the pairing process. The initiator send a IOCapabilityRequest and the responding device answers with a IOCapabilityResponse.
As the name says, the IO Capabilites contain data about what the device can show to the user. This can be one of "Display Only", "Display Yes/No", "Keyboard Only", "NoInputNoOutput", "KeyboardDisplay".
According to what both devices can do, they chose the method, see here:
https://blog.bluetooth.com/bluetooth-pairing-part-4
and
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.