mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
added attribute_read_done_cb for read command in esp_matter_controller component
This commit is contained in:
@@ -160,6 +160,10 @@ void read_command::OnDeallocatePaths(chip::app::ReadPrepareParams &&aReadPrepare
|
||||
void read_command::OnDone(ReadClient *apReadClient)
|
||||
{
|
||||
ESP_LOGI(TAG, "read done");
|
||||
|
||||
if (attribute_data_ondone_cb) {
|
||||
attribute_data_ondone_cb();
|
||||
}
|
||||
chip::Platform::Delete(apReadClient);
|
||||
chip::Platform::Delete(this);
|
||||
}
|
||||
@@ -167,7 +171,7 @@ void read_command::OnDone(ReadClient *apReadClient)
|
||||
esp_err_t send_read_attr_command(uint64_t node_id, uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id)
|
||||
{
|
||||
read_command *cmd = chip::Platform::New<read_command>(node_id, endpoint_id, cluster_id, attribute_id,
|
||||
READ_ATTRIBUTE, nullptr, nullptr);
|
||||
READ_ATTRIBUTE, nullptr, nullptr,nullptr);
|
||||
if (!cmd) {
|
||||
ESP_LOGE(TAG, "Failed to alloc memory for read_command");
|
||||
return ESP_ERR_NO_MEM;
|
||||
@@ -179,7 +183,7 @@ esp_err_t send_read_attr_command(uint64_t node_id, uint16_t endpoint_id, uint32_
|
||||
esp_err_t send_read_event_command(uint64_t node_id, uint16_t endpoint_id, uint32_t cluster_id, uint32_t event_id)
|
||||
{
|
||||
read_command *cmd =
|
||||
chip::Platform::New<read_command>(node_id, endpoint_id, cluster_id, event_id, READ_EVENT, nullptr, nullptr);
|
||||
chip::Platform::New<read_command>(node_id, endpoint_id, cluster_id, event_id, READ_EVENT, nullptr,nullptr, nullptr);
|
||||
if (!cmd) {
|
||||
ESP_LOGE(TAG, "Failed to alloc memory for read_command");
|
||||
return ESP_ERR_NO_MEM;
|
||||
|
||||
Reference in New Issue
Block a user