Address review: an empty service table with nodes logs a warning

A service-less device or a failed materialization both leave the nodes
unable to resolve; the client no longer sits inert without a trace.
This commit is contained in:
J. Nick Koston
2026-08-09 14:20:31 -05:00
parent c98dd74e11
commit 1d0a87daa8
@@ -159,6 +159,11 @@ void BLEClient::on_service_discovery_done(int error) {
// Materialize only when a node will read it: a client with no nodes
// would pay the build/free cycle on every (re)connect for nothing.
auto table = this->backend_->get_service_table();
if (table.service_count == 0) {
// A service-less device or a failed materialization: either way the
// nodes cannot resolve, so say so instead of sitting inert.
ESP_LOGW(TAG, "[%s] Service table is empty; nodes will not resolve", this->address_str_);
}
for (auto *node : this->nodes_) {
node->on_connected(table);
if (this->state_ != State::CONNECTED) {