From 585c834c11e59c4e021da4ade5acb7e1e7159e1b Mon Sep 17 00:00:00 2001 From: Sayon Deep Date: Wed, 3 Jul 2024 17:29:46 +0530 Subject: [PATCH] examples/matter: fixed passing address of local variable --- .../main/read_node_info.cpp | 2 +- .../matter_controller_with_touchscreen/main/read_node_info.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/matter/matter_controller_with_touchscreen/main/read_node_info.cpp b/examples/matter/matter_controller_with_touchscreen/main/read_node_info.cpp index 2ccda42..d47ce0f 100644 --- a/examples/matter/matter_controller_with_touchscreen/main/read_node_info.cpp +++ b/examples/matter/matter_controller_with_touchscreen/main/read_node_info.cpp @@ -526,7 +526,7 @@ static void parse_cb_response(cb_data* _data) ep_cluster* curr_cluster = node_ptr->get_cluster_ptr[_data->attr_path.mClusterId]; - cl_attribute* nattribute = new cl_attribute(_data->attr_path.mAttributeId,&esp_val); + cl_attribute* nattribute = new cl_attribute(_data->attr_path.mAttributeId,esp_val); curr_cluster->get_attribute_ptr[_data->attr_path.mAttributeId] = nattribute; diff --git a/examples/matter/matter_controller_with_touchscreen/main/read_node_info.h b/examples/matter/matter_controller_with_touchscreen/main/read_node_info.h index d3e1535..9e0d21c 100644 --- a/examples/matter/matter_controller_with_touchscreen/main/read_node_info.h +++ b/examples/matter/matter_controller_with_touchscreen/main/read_node_info.h @@ -23,10 +23,10 @@ typedef struct attributes esp_matter_attr_val_t esp_value; - attributes(uint32_t attributeid, esp_matter_attr_val_t* esp_val) + attributes(uint32_t attributeid, esp_matter_attr_val_t& esp_val) { this->attribute_id = attributeid; - this->esp_value = *esp_val; + this->esp_value = *(&esp_val); } }cl_attribute;