From 798b7c92c46cc42e4fe0310edae8c6114c9727e2 Mon Sep 17 00:00:00 2001 From: Shen Weilong Date: Thu, 12 Sep 2024 20:36:39 +0800 Subject: [PATCH] fix(ble): fiexed the crash issue of examples/bluetooth/nimble/ble_multi_conn --- .../ble_multi_conn/ble_multi_conn_prph/main/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/bluetooth/nimble/ble_multi_conn/ble_multi_conn_prph/main/main.c b/examples/bluetooth/nimble/ble_multi_conn/ble_multi_conn_prph/main/main.c index 5067899880..e32cd6355f 100644 --- a/examples/bluetooth/nimble/ble_multi_conn/ble_multi_conn_prph/main/main.c +++ b/examples/bluetooth/nimble/ble_multi_conn/ble_multi_conn_prph/main/main.c @@ -194,9 +194,9 @@ ble_prph_gap_event(struct ble_gap_event *event, void *arg) /* A new connection was established. */ ESP_LOGI(TAG, "Connection established. Handle:%d. Total:%d", event->connect.conn_handle, ++s_ble_prph_conn_num); -#if !CONFIG_EXAMPLE_EXTENDED_ADV && CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED - ble_prph_restart_adv(); -#endif // !CONFIG_EXAMPLE_EXTENDED_ADV && CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED +#if CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED + ble_prph_restart_adv(); +#endif //CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED } else { /* Restart the advertising */ ble_prph_restart_adv(); @@ -214,9 +214,6 @@ ble_prph_gap_event(struct ble_gap_event *event, void *arg) #if CONFIG_EXAMPLE_EXTENDED_ADV case BLE_GAP_EVENT_ADV_COMPLETE: ESP_LOGI(TAG, "advertisement completed. Reason=%d.",event->adv_complete.reason); -#if CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED - ble_prph_restart_adv(); -#endif // CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED return 0; #endif // CONFIG_EXAMPLE_EXTENDED_ADV