From 0d46b1047ef4ed3653c9c1785c4e394a45d02820 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 12 Aug 2026 16:38:33 -0500 Subject: [PATCH] Name the failure in the discovery-bailout log A failed search or count was indistinguishable from a service-less peer. --- esphome/components/ble_client/ble_client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/ble_client/ble_client.cpp b/esphome/components/ble_client/ble_client.cpp index 5ad53ccc09..9c01dfea2d 100644 --- a/esphome/components/ble_client/ble_client.cpp +++ b/esphome/components/ble_client/ble_client.cpp @@ -199,7 +199,9 @@ void BLEClient::handle_gatt_search_cmpl_(esp_gatt_status_t status) { bluetooth_connection::BluedroidServiceTable table; if (!counted || service_total == 0 || !table.build(this->gattc_if_, this->conn_id_, service_total, this->connection_index_)) { - ESP_LOGW(TAG, "[%s] Service table is empty; treating as failed discovery", this->address_str()); + // Distinguishes a failed search/count from a genuinely service-less peer. + ESP_LOGW(TAG, "[%s] Service table unavailable (status=%d, services=%u); treating as failed discovery", + this->address_str(), status, service_total); this->disconnect(); return; }