From 5b28ebd931884632dcdfce06c501e9ebcdec550c Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Thu, 3 Aug 2023 12:13:38 +0800 Subject: [PATCH] Controller: Pass remote node id to the report callbacks of read/subscribe commands --- .../esp_matter_controller_read_command.cpp | 4 ++-- .../esp_matter_controller_subscribe_command.cpp | 4 ++-- .../esp_matter_controller/esp_matter_controller_utils.h | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/esp_matter_controller/esp_matter_controller_read_command.cpp b/components/esp_matter_controller/esp_matter_controller_read_command.cpp index 5f4eef9ce..eb63f6031 100644 --- a/components/esp_matter_controller/esp_matter_controller_read_command.cpp +++ b/components/esp_matter_controller/esp_matter_controller_read_command.cpp @@ -116,7 +116,7 @@ void read_command::OnAttributeData(const chip::app::ConcreteDataAttributePath &p } if (attribute_data_cb) { - attribute_data_cb(path, data); + attribute_data_cb(m_node_id, path, data); } } @@ -142,7 +142,7 @@ void read_command::OnEventData(const chip::app::EventHeader &event_header, chip: } if (event_data_cb) { - event_data_cb(event_header, data); + event_data_cb(m_node_id, event_header, data); } } diff --git a/components/esp_matter_controller/esp_matter_controller_subscribe_command.cpp b/components/esp_matter_controller/esp_matter_controller_subscribe_command.cpp index 545fb81eb..5fc0c9423 100644 --- a/components/esp_matter_controller/esp_matter_controller_subscribe_command.cpp +++ b/components/esp_matter_controller/esp_matter_controller_subscribe_command.cpp @@ -118,7 +118,7 @@ void subscribe_command::OnAttributeData(const chip::app::ConcreteDataAttributePa } if (attribute_data_cb) { - attribute_data_cb(path, data); + attribute_data_cb(m_node_id, path, data); } } @@ -144,7 +144,7 @@ void subscribe_command::OnEventData(const chip::app::EventHeader &event_header, } if (event_data_cb) { - event_data_cb(event_header, data); + event_data_cb(m_node_id, event_header, data); } } diff --git a/components/esp_matter_controller/esp_matter_controller_utils.h b/components/esp_matter_controller/esp_matter_controller_utils.h index 5783c17d7..6a58a2456 100644 --- a/components/esp_matter_controller/esp_matter_controller_utils.h +++ b/components/esp_matter_controller/esp_matter_controller_utils.h @@ -22,8 +22,10 @@ namespace esp_matter { namespace controller { -using attribute_report_cb_t = void (*)(const chip::app::ConcreteDataAttributePath &path, chip::TLV::TLVReader *data); -using event_report_cb_t = void (*)(const chip::app::EventHeader &header, chip::TLV::TLVReader *data); +using attribute_report_cb_t = void (*)(uint64_t remote_node_id, const chip::app::ConcreteDataAttributePath &path, + chip::TLV::TLVReader *data); +using event_report_cb_t = void (*)(uint64_t remote_node_id, const chip::app::EventHeader &header, + chip::TLV::TLVReader *data); } // namespace controller } // namespace esp_matter