zap
zap copied to clipboard
min/max not supported for attribute size larger than 2 bytes
I have this attribute
<attribute side="server" code="0x0000" define="OPEN_DURATION" type="elapsed_s" isNullable="true" min="1" writable="true" optional="false">
<description>OpenDuration</description>
<access op="read" privilege="view"/>
<access op="write" privilege="manage"/>
</attribute>
and autogen fails with the following error:
🤖 Generating files:
✍ /Users/f/Sources/connectedhomeip/out/debug/gen/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/zap_pregen/zap-generated/CHIPClusters.h
✍ /Users/f/Sources/connectedhomeip/out/debug/gen/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/zap_pregen/zap-generated/IMClusterCommandHandler.cpp
✍ /Users/f/Sources/connectedhomeip/out/debug/gen/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/zap_pregen/zap-generated/gen_config.h
✍ /Users/f/Sources/connectedhomeip/out/debug/gen/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/zap_pregen/zap-generated/access.h
⚠️ Errors:
👎 /Users/f/Sources/connectedhomeip/out/debug/gen/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/zap_pregen/zap-generated/endpoint_config.h:
⛔ Error: Can't have min/max for attributes larger than 2 bytes like 'OpenDuration' [line: 25, column: 35, file: /Users/f/Sources/connectedhomeip/examples/all-clusters-app/linux/third_party/connectedhomeip/src/app/zap-templates/templates/app/endpoint_config.zapt ]
@tecimovic any ideas on why this constraint was added in helper-endpointconfig.js?
@tecimovic any ideas on why this constraint was added in helper-endpointconfig.js?
This is a ZIgbeePro constraint due to how the union for that is constructed. We should parametrize this, so that Matter doesn't follow this constraint.
Note that for Matter we would also need to change the codegen to output something that actually works with > 16 bits. Right now it does not.
This is coming up frequently and we need to resolve this. See https://csamembers.slack.com/archives/C01B01GH64E/p1700063239142299