Skip to content

Commit b5ed068

Browse files
committed
ble_gatts: stop advertising when GATT is connected
1 parent ff6cbd7 commit b5ed068

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main/src/user/ble_gatts.c

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ static void profile_ota_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t
139139
case ESP_GATTS_CONNECT_EVT: {
140140
xEventGroupClearBits(user_event_group, BLE_GATTS_IDLE_BIT);
141141

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

0 commit comments

Comments
 (0)