Skip to content

Commit

Permalink
Added PCC cluster to the helper.js in order to get IM callbacks (#7515)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and pan- committed Jun 30, 2023
1 parent 586162e commit 7c94f57
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,10 @@
const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \
(EmberAfGenericClusterFunction) emberAfDoorLockClusterServerAttributeChangedCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \
(EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \
(EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerAttributeChangedCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \
(EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \
}; \
Expand Down Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
11 changes: 10 additions & 1 deletion examples/pump-app/pump-common/gen/endpoint_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@
}; \
const EmberAfGenericClusterFunction chipFuncArrayBasicServer[] = { \
(EmberAfGenericClusterFunction) emberAfBasicClusterServerInitCallback, \
}; \
const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \
(EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \
(EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerAttributeChangedCallback, \
};

#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-controller-app/cc13x2x7_26x2x7/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 5 additions & 3 deletions src/app/zap-templates/templates/app/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ];

Expand Down

0 comments on commit 7c94f57

Please sign in to comment.