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

[ZAP] The generated defaults in endpoint_config.h does not comply with endianness #11413

Closed
tlykkeberg-grundfos opened this issue Nov 4, 2021 · 2 comments · Fixed by #11451
Closed

Comments

@tlykkeberg-grundfos
Copy link
Contributor

Problem

When setting a default value for a particular attribute in the .zap file, the resulting generated file endpoint_config.h does not reflect the big-endian and little-endian versions correctly. They are both stored big-endian wise. That would be expected to be different in the two GENERATED_DEFAULTS tables for big- and little-endian.

Example:
Setting the LifetimeRunningHours in the PCC cluster to 0x123456 in the ZAP UI tool, and then saving the .zap file, results in the following content in the .zap file. Which is correct.

            {
              "name": "LifetimeRunningHours",
              "code": 21,
              "mfgCode": null,
              "side": "server",
              "included": 1,
              "storageOption": "RAM",
              "singleton": 0,
              "bounded": 0,
              "defaultValue": "0x123456",
              "reportable": 0,
              "minInterval": 1,
              "maxInterval": 65534,
              "reportableChange": 0
            },

Then running the ./scripts/tools/zap_regen_all.py script generates the following contents in the endpoint_config.h file.

#if BIGENDIAN_CPU
#define GENERATED_DEFAULTS                                                                                                         \
    {                                                                                                                              \
.......
            /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */                                        \
                                                                                                                                   \
            /* 1377 - LifetimeRunningHours, */                                                                                     \
            0x12, 0x34, 0x56,                                                                                                      \
.......
#else // !BIGENDIAN_CPU
#define GENERATED_DEFAULTS                                                                                                         \
    {                                                                                                                              \
.......
            /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */                                     \
                                                                                                                                   \
            /* 1377 - LifetimeRunningHours, */                                                                                     \
            0x12, 0x34, 0x56,                                                                                                      \
                                                                                                                                   \
.......
    }

#endif // BIGENDIAN_CPU

Proposed Solution

Make the ZAP tool generate the correct default values in the endpoint_config.h files.

@jmeg-sfy
Copy link
Contributor

jmeg-sfy commented Nov 4, 2021

It is a known issues which block FeatureMap for example, some work has already been down to fix it.
So i guess there are already tickets open for this
@vivien-apple @tecimovic

@jmeg-sfy
Copy link
Contributor

jmeg-sfy commented Nov 4, 2021

#9725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants