1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 23:21:54 +00:00

suppress unused events

This commit is contained in:
J. Nick Koston
2025-06-12 19:18:22 -05:00
parent f7533dfc5c
commit 0877b3e2af

View File

@@ -383,14 +383,22 @@ template void enqueue_ble_event(esp_gatts_cb_event_t, esp_gatt_if_t, esp_ble_gat
template void enqueue_ble_event(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t *); template void enqueue_ble_event(esp_gattc_cb_event_t, esp_gatt_if_t, esp_ble_gattc_cb_param_t *);
void ESP32BLE::gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { void ESP32BLE::gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) {
switch (event) {
// Only queue the 4 GAP events we actually handle // Only queue the 4 GAP events we actually handle
if (event != ESP_GAP_BLE_SCAN_RESULT_EVT && event != ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT && case ESP_GAP_BLE_SCAN_RESULT_EVT:
event != ESP_GAP_BLE_SCAN_START_COMPLETE_EVT && event != ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT) { case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT:
ESP_LOGW(TAG, "Ignoring unexpected GAP event type: %d", event); case ESP_GAP_BLE_SCAN_START_COMPLETE_EVT:
case ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT:
enqueue_ble_event(event, param);
return;
// Ignore these GAP events as they are not relevant for our use case
case ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT:
case ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT:
return; return;
} }
ESP_LOGW(TAG, "Ignoring unexpected GAP event type: %d", event);
enqueue_ble_event(event, param);
} }
void ESP32BLE::gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if, void ESP32BLE::gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_if,