Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min/max not supported for attribute size larger than 2 bytes #1187

Open
fessehaeve opened this issue Oct 30, 2023 · 4 comments
Open

min/max not supported for attribute size larger than 2 bytes #1187

fessehaeve opened this issue Oct 30, 2023 · 4 comments
Assignees
Labels
high priority Tag that shows this as higher priority as other issues. matter Important to Matter SDK
Milestone

Comments

@fessehaeve
Copy link

fessehaeve commented Oct 30, 2023

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 ]

@brdandu
Copy link
Collaborator

brdandu commented Oct 30, 2023

@tecimovic any ideas on why this constraint was added in helper-endpointconfig.js?

@tecimovic
Copy link
Collaborator

@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.

@bzbarsky-apple
Copy link
Contributor

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.

@brdandu brdandu added the high priority Tag that shows this as higher priority as other issues. label Nov 15, 2023
@brdandu
Copy link
Collaborator

brdandu commented Nov 15, 2023

This is coming up frequently and we need to resolve this. See https://csamembers.slack.com/archives/C01B01GH64E/p1700063239142299

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority Tag that shows this as higher priority as other issues. matter Important to Matter SDK
Projects
Development

No branches or pull requests

6 participants