Unverified Commit 1ad54069 authored by aridet's avatar aridet Committed by GitHub

Fix BluetoothSerial thinking it's disconnected (#7372)

Currently, if a second connection occur in Bluetooth, this second connection is automatically disconnected (line 284).
This disconnection trigger the ESP_SPP_CLOSE_EVT, which clear the bit SPP_CONNECTED.
But the first connection remain active, and this flag shouldn't be cleared.

This fix the issue, by clearing the flag only if the last connection is closed
Co-authored-by: default avatarRodrigo Garcia <rodrigo.garcia@espressif.com>
parent 72e79f05
...@@ -301,8 +301,8 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) ...@@ -301,8 +301,8 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
xEventGroupSetBits(_spp_event_group, SPP_DISCONNECTED); xEventGroupSetBits(_spp_event_group, SPP_DISCONNECTED);
xEventGroupSetBits(_spp_event_group, SPP_CONGESTED); xEventGroupSetBits(_spp_event_group, SPP_CONGESTED);
xEventGroupSetBits(_spp_event_group, SPP_CLOSED); xEventGroupSetBits(_spp_event_group, SPP_CLOSED);
}
xEventGroupClearBits(_spp_event_group, SPP_CONNECTED); xEventGroupClearBits(_spp_event_group, SPP_CONNECTED);
}
} else { } else {
log_e("ESP_SPP_CLOSE_EVT failed!, status:%d", param->close.status); log_e("ESP_SPP_CLOSE_EVT failed!, status:%d", param->close.status);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment