Address review: on_notify_state joins the node interface

notify_characteristic() had no completion path to the node that asked;
the hook lands now while the surface has no external users, with the
client fanning out after its breadcrumb.
This commit is contained in:
J. Nick Koston
2026-08-09 13:30:08 -05:00
parent 10a0bf0ff8
commit f9be82d1a6
2 changed files with 4 additions and 2 deletions
@@ -201,12 +201,13 @@ void BLEClient::on_notify_data(uint16_t handle, const uint8_t *data, uint16_t le
}
void BLEClient::on_notify_state(uint16_t handle, bool enabled, int error) {
// Breadcrumb only until the first notify node lands; a dropped failure
// here would otherwise be silent on a frozen surface.
if (error != 0) {
ESP_LOGW(TAG, "[%s] Notify %s on handle 0x%04x failed, status=%d", this->address_str_,
enabled ? "enable" : "disable", handle, error);
}
for (auto *node : this->nodes_) {
node->on_notify_state(handle, enabled, error);
}
}
void BLEClient::on_pairing_result(int status) {
@@ -37,6 +37,7 @@ class BLEClientNode {
virtual void on_connected(const ble_device_base::GattServiceTable &table) {}
virtual void on_disconnected() {}
virtual void on_notify(uint16_t handle, const uint8_t *data, uint16_t len) {}
virtual void on_notify_state(uint16_t handle, bool enabled, int error) {}
virtual void on_read_result(uint16_t handle, const uint8_t *data, uint16_t len, int error) {}
virtual void on_write_result(uint16_t handle, int error) {}