From 72bc24c03ab126d9bfd9fc6f7a4f93b5c8edbd23 Mon Sep 17 00:00:00 2001 From: chendejin Date: Fri, 23 Aug 2024 18:23:33 +0800 Subject: [PATCH] components/esp_matter_controller: fixed reading command failed with ids --- .../commands/esp_matter_controller_read_command.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/esp_matter_controller/commands/esp_matter_controller_read_command.cpp b/components/esp_matter_controller/commands/esp_matter_controller_read_command.cpp index 252081832..9e41d081d 100644 --- a/components/esp_matter_controller/commands/esp_matter_controller_read_command.cpp +++ b/components/esp_matter_controller/commands/esp_matter_controller_read_command.cpp @@ -227,6 +227,10 @@ esp_err_t send_read_attr_command(uint64_t node_id, uint16_t endpoint_id, uint32_ attribute_ids.Alloc(1); if (!(endpoint_ids.Get() && cluster_ids.Get() && attribute_ids.Get())) { return ESP_ERR_NO_MEM; + } else { + *endpoint_ids.Get() = endpoint_id; + *cluster_ids.Get() = cluster_id; + *attribute_ids.Get() = attribute_id; } return send_read_attr_command(node_id, endpoint_ids, cluster_ids, attribute_ids); } @@ -241,6 +245,10 @@ esp_err_t send_read_event_command(uint64_t node_id, uint16_t endpoint_id, uint32 event_ids.Alloc(1); if (!(endpoint_ids.Get() && cluster_ids.Get() && event_ids.Get())) { return ESP_ERR_NO_MEM; + } else { + *endpoint_ids.Get() = endpoint_id; + *cluster_ids.Get() = cluster_id; + *event_ids.Get() = event_id; } return send_read_event_command(node_id, endpoint_ids, cluster_ids, event_ids); }