mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-30 07:21:20 +00:00
sm: accept pairing request after classic role change
This commit is contained in:
parent
8e0bef02fe
commit
dc3e249654
15
src/ble/sm.c
15
src/ble/sm.c
@ -4874,6 +4874,21 @@ static void sm_pdu_handler(sm_connection_t *sm_conn, uint8_t sm_pdu_code, const
|
||||
}
|
||||
break;
|
||||
|
||||
case SM_BR_EDR_INITIATOR_W4_FIXED_CHANNEL_MASK:
|
||||
//
|
||||
// Bluetooth Core v5.4 does not indicate which device sends the SM Pairing Request infor this case.
|
||||
//
|
||||
// When initiating the Classic connection and initiating authentication and there's a Role Change during connect
|
||||
// - Android 14 sends SM Pairing Request
|
||||
// - iOS 16 waits for SM Pairing Request
|
||||
//
|
||||
|
||||
// Workaround: we accept Peripheral Role and SM Pairing Request in Central Role
|
||||
sm_conn->sm_role = HCI_ROLE_SLAVE;
|
||||
sm_conn->sm_engine_state = SM_BR_EDR_RESPONDER_W4_PAIRING_REQUEST;
|
||||
|
||||
/* fall through */
|
||||
|
||||
case SM_BR_EDR_RESPONDER_W4_PAIRING_REQUEST:
|
||||
if (sm_pdu_code != SM_CODE_PAIRING_REQUEST){
|
||||
sm_pdu_received_in_wrong_state(sm_conn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user