From c9dddf999b86479ef71e93793b3bf79725f6ef2a Mon Sep 17 00:00:00 2001 From: Thomas Lykkeberg <80672974+tlykkeberg-grundfos@users.noreply.github.com> Date: Fri, 18 Jun 2021 21:41:30 +0200 Subject: [PATCH] Added PCC cluster to the helper.js in order to get IM callbacks (#7515) * Added PCC cluster to the helper.js in order to get IM callbacks * Restyled by clang-format * Added two missing files to from running the zap_regen_all.py * * Reverted errors in generated files under examples/tv-app/tv-common/gen * Added the to the CMakeLists.txt file under ESP32 all-clusters-app * Removed # comment in the CMakeLists.txt file which includes the build of pump-config... Co-authored-by: Restyled.io --- .../all-clusters-common/gen/endpoint_config.h | 11 ++++++++++- examples/all-clusters-app/esp32/main/CMakeLists.txt | 1 + examples/pump-app/cc13x2x7_26x2x7/BUILD.gn | 2 +- .../pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp | 2 +- examples/pump-app/pump-common/gen/endpoint_config.h | 11 ++++++++++- examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn | 2 +- .../cc13x2x7_26x2x7/main/ZclCallbacks.cpp | 2 +- .../pump-configuration-and-control-server.cpp | 2 ++ src/app/zap-templates/templates/app/helper.js | 8 +++++--- 9 files changed, 32 insertions(+), 9 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index d20a5b38742a96..091cbf32fe9b95 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -2139,6 +2139,10 @@ const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \ (EmberAfGenericClusterFunction) emberAfDoorLockClusterServerAttributeChangedCallback, \ }; \ + const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \ + (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerAttributeChangedCallback, \ + }; \ const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \ }; \ @@ -2258,7 +2262,12 @@ 0x0103, ZAP_ATTRIBUTE_INDEX(178), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(183), 8, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0200, \ + ZAP_ATTRIBUTE_INDEX(183), \ + 8, \ + 13, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ 0x0201, ZAP_ATTRIBUTE_INDEX(191), 6, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 12588dc1e0131e..e553dab70eeba7 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -58,6 +58,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/relative-humidity-measurement-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" #${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-client PRIV_REQUIRES chip QRCode tft spidriver bt screen-framework) diff --git a/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn b/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn index 7596e3a403ad7c..b71f123d1cfdbf 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/pump-app/cc13x2x7_26x2x7/BUILD.gn @@ -90,7 +90,7 @@ ti_simplelink_executable("pump_app") { ":sysconfig", "${chip_root}/examples/pump-app/pump-common", "${chip_root}/src/lib", - "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", ] include_dirs = [ diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index f6c8e4ce40a1d6..4d9ffce008408a 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -31,7 +31,7 @@ using namespace ::chip; void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { if (clusterId != ZCL_ON_OFF_CLUSTER_ID) { diff --git a/examples/pump-app/pump-common/gen/endpoint_config.h b/examples/pump-app/pump-common/gen/endpoint_config.h index ff82fd516162f3..3cd08c8d115898 100644 --- a/examples/pump-app/pump-common/gen/endpoint_config.h +++ b/examples/pump-app/pump-common/gen/endpoint_config.h @@ -752,6 +752,10 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayBasicServer[] = { \ (EmberAfGenericClusterFunction) emberAfBasicClusterServerInitCallback, \ + }; \ + const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \ + (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \ + (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerAttributeChangedCallback, \ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask @@ -803,7 +807,12 @@ 0x003E, ZAP_ATTRIBUTE_INDEX(98), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(100), 8, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0200, \ + ZAP_ATTRIBUTE_INDEX(100), \ + 8, \ + 13, \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ 0x0402, ZAP_ATTRIBUTE_INDEX(108), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn b/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn index 1c5cef705f133e..438b87ef8c58cc 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn @@ -90,7 +90,7 @@ ti_simplelink_executable("pump_controller_app") { ":sysconfig", "${chip_root}/examples/pump-controller-app/pump-controller-common", "${chip_root}/src/lib", - "${openthread_root}:libopenthread-cli-ftd", + "${openthread_root}:libopenthread-ftd", ] include_dirs = [ diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index f6c8e4ce40a1d6..4d9ffce008408a 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -31,7 +31,7 @@ using namespace ::chip; void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { if (clusterId != ZCL_ON_OFF_CLUSTER_ID) { diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp index e8f31ae1756c46..2a0373086dd91a 100644 --- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -29,10 +29,12 @@ using namespace chip; void emberAfPumpConfigurationAndControlClusterServerInitCallback(EndpointId endpoint) { + emberAfDebugPrintln("Initialize PCC Server Cluster [EP:%d]", endpoint); // TODO } void emberAfPumpConfigurationAndControlClusterServerAttributeChangedCallback(EndpointId endpoint, AttributeId attributeId) { + emberAfDebugPrintln("PCC Server Cluster Attribute changed [EP:%d, ID:0x%x]", endpoint, attributeId); // TODO } diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 5245c49c82514f..c8d15e58f0c91f 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -195,9 +195,11 @@ function asChipUnderlyingType(label, type) // These helpers only works within the endpoint_config iterator // List of all cluster with generated functions -var endpointClusterWithInit = - [ 'Basic', 'Identify', 'Groups', 'Scenes', 'Occupancy Sensing', 'On/off', 'Level Control', 'Color Control', 'IAS Zone' ]; -var endpointClusterWithAttributeChanged = [ 'Identify', 'Door Lock' ]; +var endpointClusterWithInit = [ + 'Basic', 'Identify', 'Groups', 'Scenes', 'Occupancy Sensing', 'On/off', 'Level Control', 'Color Control', 'IAS Zone', + 'Pump Configuration and Control' +]; +var endpointClusterWithAttributeChanged = [ 'Identify', 'Door Lock', 'Pump Configuration and Control' ]; var endpointClusterWithPreAttribute = [ 'IAS Zone' ]; var endpointClusterWithMessageSent = [ 'IAS Zone' ];