fix(nimble): Keep only BLE_GAP_EVENT_CONNECT gap event

This commit is contained in:
Rahul Tank
2025-02-27 16:21:31 +05:30
parent de853be81e
commit 891f86d649
30 changed files with 212 additions and 212 deletions
@@ -389,18 +389,18 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
int rc;
switch (event->type) {
case BLE_GAP_EVENT_LINK_ESTAB:
case BLE_GAP_EVENT_CONNECT:
/* A new connection was established or a connection attempt failed. */
ESP_LOGI(TAG, "connection %s; status=%d ",
event->link_estab.status == 0 ? "established" : "failed",
event->link_estab.status);
if (event->link_estab.status == 0) {
rc = ble_gap_conn_find(event->link_estab.conn_handle, &desc);
event->connect.status == 0 ? "established" : "failed",
event->connect.status);
if (event->connect.status == 0) {
rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
assert(rc == 0);
bleprph_print_conn_desc(&desc);
}
if (event->link_estab.status != 0) {
if (event->connect.status != 0) {
/* Connection failed; resume advertising. */
bleprph_advertise();
}