You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now on my end device, when the command gets received, I have a callback like this below which gets invoked. This is all good when all I need to do is perform some write action on the device, but not send a response back to the Matter controller.
The problem I have is when I want to read and send data from the end device back to the Matter controller application.
I am tying to avoid using attributes, and then having to use other Matter controller calls to read attributes (which should be kept updated on the end device even without being requested) :
static esp_err_t custom_command_callback(const ConcreteCommandPath &command_path, TLVReader &tlv_data,
void *opaque_ptr)
{
// I would like to read data here and somehow get this back to the Matter Controller
}
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Matter Controller - Getting data from a customized cluster command
Matter Controller - Getting data from a customized cluster command (CON-1413)
Nov 13, 2024
Hi, for the command data parsing, you can follow the codes in esp_matter_rainmaker component here which decodes the TLV reader to a char string.
As for the command response, You can add a simple status response by call AddStatus()
chip::app::CommandHandler *command_obj = (chip::app::CommandHandler *)opaque_ptr;
if (!command_obj) {
ESP_LOGE(TAG, "Command Object cannot be NULL");
return;
}
command_obj->AddStatus(command_path, chip::Protocols::InteractionModel::Status::Success);
But if you want to add response which has complex data field, I would suggest you to add you cluster definition xml file to connectedhomeip/src/app/zap-templates/zcl/data-model/chip and generate the app-common files with your xml file then it will be much easier to use AddResponse() with the command object.
I am using the
esp_matter_controller
to issue commands to a customized cluster server on a Matter end device.From the Matter controller side, I send the command to my end device as follows :
Now on my end device, when the command gets received, I have a callback like this below which gets invoked. This is all good when all I need to do is perform some write action on the device, but not send a response back to the Matter controller.
The problem I have is when I want to read and send data from the end device back to the Matter controller application.
I am tying to avoid using attributes, and then having to use other Matter controller calls to read attributes (which should be kept updated on the end device even without being requested) :
The text was updated successfully, but these errors were encountered: