diff --git a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp index a32f077e21cfc0..14a1ea7c2c6338 100644 --- a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp @@ -35,6 +35,7 @@ #include "route_hook/esp_route_hook.h" #include #include +#include #include #include #include @@ -156,6 +157,9 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster OnColorControlAttributeChangeCallback(endpointId, attributeId, value); break; #endif + case ZCL_IDENTIFY_CLUSTER_ID: + OnIdentifyAttributeChangeCallback(endpointId, attributeId, value); + break; default: ESP_LOGI(TAG, "Unhandled cluster ID: %d", clusterId); break; @@ -254,6 +258,15 @@ void DeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpointI } #endif +void DeviceCallbacks::OnIdentifyAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t * value) +{ + if (attributeId == ZCL_IDENTIFY_TIME_ATTRIBUTE_ID) + { + uint8_t identifyTime = *value; + emberAfWriteServerAttribute(endpointId, ZCL_IDENTIFY_CLUSTER_ID,ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, &identifyTime, ZCL_INT8U_ATTRIBUTE_TYPE); + } +} + bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); diff --git a/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h b/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h index 91cfcba3936eea..4c7238f440ef35 100644 --- a/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h +++ b/examples/all-clusters-app/esp32/main/include/DeviceCallbacks.h @@ -45,5 +45,6 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks #if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM void OnColorControlAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); #endif + void OnIdentifyAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); bool mEndpointOnOffState[2]; };