gatt_client: don't trigger pairing for reactive authentication without automatic pairing

This commit is contained in:
Matthias Ringwald 2020-11-26 18:10:58 +01:00
parent fd14b2051a
commit cf31ef9b5b

View File

@ -1229,8 +1229,7 @@ static void gatt_client_event_packet_handler(uint8_t packet_type, uint16_t chann
gatt_client->reencryption_active = false;
gatt_client->wait_for_authentication_complete = 0;
bool client_request_pending = gatt_client->gatt_client_state != P_READY;
if (!client_request_pending) break;
if (gatt_client->gatt_client_state == P_READY) break;
switch (sm_event_reencryption_complete_get_status(packet)){
case ERROR_CODE_SUCCESS:
@ -1238,9 +1237,9 @@ static void gatt_client_event_packet_handler(uint8_t packet_type, uint16_t chann
break;
case ERROR_CODE_AUTHENTICATION_FAILURE:
case ERROR_CODE_PIN_OR_KEY_MISSING:
#ifndef ENABLE_LE_PROACTIVE_AUTHENTICATION
#if defined(ENABLE_GATT_CLIENT_PAIRING) && !defined(ENABLE_LE_PROACTIVE_AUTHENTICATION)
if (gatt_client_required_security_level == LEVEL_0) {
// re-encryption failed for reactive authentication and we have a pending client request
// re-encryption failed for reactive authentication with pairing and we have a pending client request
// => try to resolve it by deleting bonding information if we started pairing before
// delete bonding information
int le_device_db_index = sm_le_device_index(gatt_client->con_handle);