Skip to content

Commit d823d86

Browse files
committed
ble_gatts: stop advertising when GATT is connected
1 parent 0fa59b8 commit d823d86

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main/src/user/ble_gatts.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ static void profile_ota_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
138138
case ESP_GATTS_CONNECT_EVT: {
139139
xEventGroupClearBits(user_event_group, BLE_GATTS_IDLE_BIT);
140140

141+
esp_ble_gap_stop_advertising();
142+
141143
uint8_t *bda = param->connect.remote_bda;
142144
ESP_LOGI(GATTS_OTA_TAG, "GATTS connection state: %s, [%02x:%02x:%02x:%02x:%02x:%02x]",
143145
s_gatts_conn_state_str[1], bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]);

0 commit comments

Comments
 (0)