-
I'm having trouble reconnecting to a already paired device. I'm using /*
* store key type deducted from pairing method used
* it is important to store it since type is used to determine
* security level upon encryption
*/
switch (smp->method) {
case PASSKEY_DISPLAY:
case PASSKEY_INPUT:
case PASSKEY_CONFIRM:
case LE_SC_OOB:
case LEGACY_OOB:
conn->le.keys->flags |= BT_KEYS_AUTHENTICATED;
break;
case JUST_WORKS:
default:
/* unauthenticated key, clear it */
conn->le.keys->flags &= ~BT_KEYS_AUTHENTICATED;
break;
} This treats I got here because of the The Is this a bug? Am I doing something wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
It is intentional, just works is not authenticated, and we don't allow bond overwrites without authentication.
|
Beta Was this translation helpful? Give feedback.
-
@joerchan I tried this option. This made it so I had to pair (press Pair button on iPhone) each time I tried to reconnect to a peripheral device. Is that the intended behavior? |
Beta Was this translation helpful? Give feedback.
-
Things I didn't know before I started investigating it: I'm using Secure Connection pairing here. Ok so after some investigation and a lot of help, we established that the problem is with iOS accessing the CCCD characteristic.
The iPhone attempts to write to a characteristic (looks like it's a subscription to a CCCD), and Zephyr responds with insufficient authentication (on the second connection). That results with iPhone creating a new bond every time. The workaround is to change this:
into
That lowers the write access to CCCD to security lvl 2. After that iPhone should be able to restore connection. |
Beta Was this translation helpful? Give feedback.
Things I didn't know before I started investigating it: I'm using Secure Connection pairing here.
Ok so after some investigation and a lot of help, we established that the problem is with iOS accessing the CCCD characteristic.
The iPhone attempts to write to a characteris…