mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(ble): fiexed the crash issue of examples/bluetooth/nimble/ble_multi_conn
This commit is contained in:
parent
1889851d7c
commit
798b7c92c4
@ -194,9 +194,9 @@ ble_prph_gap_event(struct ble_gap_event *event, void *arg)
|
|||||||
/* A new connection was established. */
|
/* A new connection was established. */
|
||||||
ESP_LOGI(TAG, "Connection established. Handle:%d. Total:%d", event->connect.conn_handle,
|
ESP_LOGI(TAG, "Connection established. Handle:%d. Total:%d", event->connect.conn_handle,
|
||||||
++s_ble_prph_conn_num);
|
++s_ble_prph_conn_num);
|
||||||
#if !CONFIG_EXAMPLE_EXTENDED_ADV && CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED
|
#if CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED
|
||||||
ble_prph_restart_adv();
|
ble_prph_restart_adv();
|
||||||
#endif // !CONFIG_EXAMPLE_EXTENDED_ADV && CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED
|
#endif //CONFIG_EXAMPLE_RESTART_ADV_AFTER_CONNECTED
|
||||||
} else {
|
} else {
|
||||||
/* Restart the advertising */
|
/* Restart the advertising */
|
||||||
ble_prph_restart_adv();
|
ble_prph_restart_adv();
|
||||||
@ -214,9 +214,6 @@ ble_prph_gap_event(struct ble_gap_event *event, void *arg)
|
|||||||
#if CONFIG_EXAMPLE_EXTENDED_ADV
|
#if CONFIG_EXAMPLE_EXTENDED_ADV
|
||||||
case BLE_GAP_EVENT_ADV_COMPLETE:
|
case BLE_GAP_EVENT_ADV_COMPLETE:
|
||||||
ESP_LOGI(TAG, "advertisement completed. Reason=%d.",event->adv_complete.reason);
|
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;
|
return 0;
|
||||||
#endif // CONFIG_EXAMPLE_EXTENDED_ADV
|
#endif // CONFIG_EXAMPLE_EXTENDED_ADV
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user