mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-28 11:28:32 +00:00
42075d5c75
- data_model/legacy/: moved old data model to this folder - data_model/generated/: contain the automatically generated data model - tools/data_model_gen: contains the script to generate the data model
23 lines
1016 B
Django/Jinja
23 lines
1016 B
Django/Jinja
{% for command in cluster.get_commands() %}
|
|
{% if command.has_callback %}
|
|
|
|
static esp_err_t esp_matter_command_callback_{{ command.func_name | lower }}(const ConcreteCommandPath &command_path, TLVReader &tlv_data,
|
|
void *opaque_ptr)
|
|
{
|
|
chip::app::Clusters::{{ cluster.chip_name }}::Commands::{{ command.name }}::DecodableType command_data;
|
|
{% if command.is_fabric_scoped %}
|
|
chip::app::CommandHandler *command_obj = (chip::app::CommandHandler *)opaque_ptr;
|
|
CHIP_ERROR error = command_data.Decode(tlv_data, command_obj->GetAccessingFabricIndex());
|
|
{% else %}
|
|
CHIP_ERROR error = Decode(tlv_data, command_data);
|
|
{% endif %}
|
|
if (error == CHIP_NO_ERROR) {
|
|
{% if command.direction == 'commandToServer' %}
|
|
emberAf{{ cluster.chip_name }}Cluster{{ command.name }}Callback((CommandHandler *)opaque_ptr, command_path, command_data);
|
|
{% endif %}
|
|
}
|
|
return ESP_OK;
|
|
}
|
|
{% endif %}
|
|
{% endfor %}
|