From d1e1a57fd30595f9308bed33297460ce1472a62e Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 14 May 2018 17:34:37 +0200 Subject: [PATCH] gatt_client: wait until central re-encryption is complete --- src/ble/gatt_client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ble/gatt_client.c b/src/ble/gatt_client.c index 5c8621705..33de09d33 100644 --- a/src/ble/gatt_client.c +++ b/src/ble/gatt_client.c @@ -822,6 +822,9 @@ static int is_value_valid(gatt_client_t *peripheral, uint8_t *packet, uint16_t s static int gatt_client_run_for_peripheral( gatt_client_t * peripheral){ // log_info("- handle_peripheral_list, mtu state %u, client state %u", peripheral->mtu_state, peripheral->gatt_client_state); + // wait until re-encryption as central is complete + if (gap_reconnect_security_setup_active(peripheral->con_handle)) return 0; + switch (peripheral->mtu_state) { case SEND_MTU_EXCHANGE: peripheral->mtu_state = SENT_MTU_EXCHANGE;