-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[ZAP] Update endpoint_config.zapt template #9725
[ZAP] Update endpoint_config.zapt template #9725
Conversation
For what it worth I have confirmed that it happens for global attributes and not the other by trying to change the value of an other |
I see that we did not have global attributes of size greater than 2 bytes before and did not account for the use case where global attributes made it into the Generated Defaults. However FeatureMap is a global attribute which has a size of 4 bytes and needs go into generated defaults in order to save space. Is the app failing to work because of no generated default for FeatureMap? Isn't the FeatureMap attribute default value still generated under GENERATED_ATTRIBUTES directly?
|
Casting to connectedhomeip/src/app/util/af-types.h Line 103 in 53dd583
In any case storing it as a real value would not work since connectedhomeip/src/app/util/af-types.h Line 116 in 53dd583
Because the stack think it is a
memmove with this address as src in
Here is the generated code in
|
I see. Looking into this currently. Will update once I have pushed a fix. |
Hi Hope you can advance on this topic soon; let us know |
607120d
to
a523600
Compare
I have pushed an updated version that generates content using the fix that has been introduced into ZAP for global attributes not beeing generated properly. But, this branch still needs an other ZAP update once project-chip/zap#233 lands and it also needs #4369 to be fixed in some ways. |
a523600
to
73eacbe
Compare
73eacbe
to
e8cd51b
Compare
@woody-apple @vivien-apple can we merge this or ZAP is still required to be updated ? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
not stale |
There is still some issues with ZAP. Nothing that is quick to fix. I assume I will have to do a different patch to fix the endianness problem you are interested in. |
Fwiw, the endianness problem was fixed in #11451 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Would the Linux kernel solution help out here? Check out include/linux/byteorder/genric.h in Linux kernel. Basically you use these macros when generating code:
Those say host to network order or network order to host. Then the h file does the magic needed to avoid the endianess problems. So if the endianess matches, these macros disappear. Otherwise they do the necessary byte swaps. There are fancier inlines lower down in the file for dealing with arrays. You can also use C++ features to hide these conversions. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
/rebase |
Closing as the endianness issue has been fixed by #11451 and will likely revisit this later in time. |
Problem
#9246 is trying to use the
FeatureMap
global attribute for theWindowCovering
cluster. It ends up into some endianness issues with the `GENERATED_DEFAULTS.I tried to upgrade the
endpoint_config.zapt
template to use the new syntax from upstream ZAP, and eventually fix the endianness issue.I have kept this PR as a drag because big and little endian properly generates different defaults but it seems like the global attributes are not taken into account in the sql query at https://github.com/project-chip/zap/blob/bd655586081b4ea444d37fd455d5a817e417bd1c/src-electron/db/query-attribute.js#L407
For the thermostat cluster, instead of generating values into
GENERATED_DEFAULTS
, the value is put directly intoGENERATED_ATTRIBUTES
as aptrDefautValue
:If you try to run
chip-all-clusters-app
locally it crashes:There is an other issue with the size of
ARRAY
/List not properly taken into account too into the SQL request from the ZAP repo, but I have a local fix for this one. Getting global attributes into the sql query result is an other story looking at the size fo the query...Change overview
endpoint_config.zapt
templateTesting