From e45092ea43bf625192bec8de6f99bfeb94acfffb Mon Sep 17 00:00:00 2001 From: Chirag Atal Date: Thu, 24 Feb 2022 15:05:29 +0530 Subject: [PATCH] esp_matter_command: Sending response for custom commands Earlier no response was being sent. Now sending the default response. --- components/esp_matter/esp_matter_command.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/esp_matter/esp_matter_command.cpp b/components/esp_matter/esp_matter_command.cpp index 42aaf8a92..d534a0efe 100644 --- a/components/esp_matter/esp_matter_command.cpp +++ b/components/esp_matter/esp_matter_command.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -64,7 +65,9 @@ void DispatchSingleClusterCommandCommon(const ConcreteCommandPath &command_path, int flags = esp_matter_command_get_flags(command); if (flags & COMMAND_MASK_CUSTOM) { if (custom_callback) { - custom_callback(endpoint_id, cluster_id, command_id, tlv_data, custom_callback_priv_data); + esp_err_t err = custom_callback(endpoint_id, cluster_id, command_id, tlv_data, custom_callback_priv_data); + EmberAfStatus status = (err == ESP_OK) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; + emberAfSendImmediateDefaultResponse(status); } } else { esp_matter_command_callback_t callback = esp_matter_command_get_callback(command);