Skip to content

Commit

Permalink
Update ZAP. (#19812)
Browse files Browse the repository at this point in the history
* Update ZAP.

Fixes type sizes for external attributes for which a size is known.

Fixes #19647

The darwin-framework-tool change for bitmaps was needed because
presumably something changed on the ZAP side in terms of weak bitmaps
suddenly testing true for if_is_bitmap, which I thought they had
already been doing...

* Ignore the size of external attributes when computing offsets into the singleton store.

External attributes are not actually stored in the singleton store.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Aug 22, 2023
1 parent f985bac commit 1978146
Show file tree
Hide file tree
Showing 48 changed files with 3,083 additions and 3,076 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
fd3adabbb2ac031d765da028fb51475260b7cfaf
9a4e455c3a4956842d11971148b2d5ee0ccead53

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
{{#if_chip_enum type}}
{{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})];
{{else}}
{{#if_is_bitmap type}}
{{#if_is_strongly_typed_bitmap type}}
{{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}.Raw()];
{{else if (isOctetString type)}}
{{target}} = [NSData dataWithBytes:{{source}}.data() length:{{source}}.size()];
{{else if (isCharString type)}}
{{target}} = [[NSString alloc] initWithBytes:{{source}}.data() length:{{source}}.size() encoding:NSUTF8StringEncoding];
{{else}}
{{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:{{source}}];
{{/if_is_bitmap}}
{{/if_is_strongly_typed_bitmap}}
{{/if_chip_enum}}
{{/if_is_struct}}
{{/if}}
7 changes: 7 additions & 0 deletions src/app/util/attribute-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ struct EmberAfAttributeMetadata
*/
bool IsExternal() const { return mask & ATTRIBUTE_MASK_EXTERNAL_STORAGE; }

/**
* Check whether this is a "singleton" attribute, in the sense that it has a
* single value across multiple instances of the cluster. This is not
* mutually exclusive with the attribute being external.
*/
bool IsSingleton() const { return mask & ATTRIBUTE_MASK_SINGLETON; }

/**
* Check whether this attribute is automatically stored in non-volatile
* memory.
Expand Down
2 changes: 1 addition & 1 deletion src/app/util/attribute-storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static uint8_t * singletonAttributeLocation(const EmberAfAttributeMetadata * am)
uint16_t index = 0;
while (m < am)
{
if ((m->mask & ATTRIBUTE_MASK_SINGLETON) != 0U)
if (m->IsSingleton() && !m->IsExternal())
{
index = static_cast<uint16_t>(index + m->size);
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/zap/repo
Submodule repo updated 71 files
+2 −1 .github/workflows/cypress.yml
+6 −3 .github/workflows/release.yml
+5 −1 .github/workflows/sonarcloud.yml
+9 −14 .github/workflows/zap.yml
+1 −0 Jenkinsfile
+1 −1 apack.json
+2 −0 cypress.json
+18 −0 cypress/integration/attributes/check-cluster-attributes-singleton-in-zigbee-mode.spec.js
+0 −4 cypress/integration/custom_xml/custom_xml.zap
+32 −0 cypress/integration/file_operation/file_open.spec.js
+6 −13 cypress/integration/theme/theme.spec.js
+17 −0 cypress/support/commands.js
+36,598 −33,356 package-lock.json
+9 −5 package.json
+1 −0 src-electron/db/db-mapping.js
+2 −1 src-electron/db/query-attribute.js
+2 −2 src-electron/db/query-bitmap.js
+30 −8 src-electron/db/query-cluster.js
+6 −3 src-electron/db/query-command.js
+58 −16 src-electron/db/query-endpoint-type.js
+2 −2 src-electron/db/query-enum.js
+5 −2 src-electron/db/query-loader.js
+82 −201 src-electron/db/zap-schema.sql
+26 −13 src-electron/generator/helper-endpointconfig.js
+54 −0 src-electron/generator/helper-session.js
+6 −151 src-electron/generator/helper-zcl.js
+142 −0 src-electron/generator/helper-zigbee-zcl.js
+1 −0 src-electron/generator/template-engine.js
+3 −3 src-electron/ide-integration/studio-rest-api.ts
+5 −1 src-electron/importexport/import-json.js
+19 −7 src-electron/main-process/main.ts
+100 −125 src-electron/main-process/startup.js
+45 −19 src-electron/rest/file-ops.js
+43 −58 src-electron/rest/user-data.js
+2 −6 src-electron/server/http-server.js
+3 −3 src-electron/ui/browser-api.js
+21 −24 src-electron/ui/main-ui.ts
+22 −2 src-electron/util/args.ts
+5 −0 src-electron/util/env.ts
+34 −6 src-electron/util/util.js
+34 −3 src-electron/zcl/zcl-loader-silabs.js
+42 −4 src-electron/zcl/zcl-loader.js
+0 −27 src-script/refresh-zap.js
+2 −0 src-shared/rend-api.js
+1 −0 src-shared/rest-api.js
+4 −1 src/App.vue
+13 −0 src/api/renderer_api.js
+3 −0 src/components/ZclAttributeManager.vue
+11 −3 src/components/ZclDomainClusterView.vue
+0 −7 src/components/ZclGeneralOptionsBar.vue
+51 −45 src/layouts/ZclConfiguratorLayout.vue
+9 −8 src/layouts/ZclLayout.vue
+0 −34 src/pages/PreferenceGeneration.vue
+2 −2 src/store/zap/actions.js
+8 −0 src/store/zap/state.js
+0 −5 src/util/common-mixin.js
+5 −7 test/custom-cluster.test.js
+11 −13 test/custom-zcl.test.js
+109 −0 test/gen-template/matter/endpoint-config.zapt
+5 −0 test/gen-template/matter/gen-test.json
+1 −1 test/gen-template/zigbee/zap-cli.zapt
+20 −6 test/gen-zigbee.test.js
+25 −5 test/query.test.js
+0 −4 test/resource/bead.zap
+547 −8 test/resource/gp-combo-basic-test.zap
+752 −0 test/resource/matter-sensor.zap
+28 −2 test/test-query.js
+2 −1 test/test-util.js
+6 −7 test/validation.test.js
+2 −2 test/zcl-loader-consecutive.test.js
+2 −3 zcl-builtin/silabs/zcl.json
270 changes: 135 additions & 135 deletions zzz_generated/all-clusters-app/zap-generated/endpoint_config.h

Large diffs are not rendered by default.

136 changes: 68 additions & 68 deletions zzz_generated/all-clusters-minimal-app/zap-generated/endpoint_config.h

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions zzz_generated/bridge-app/zap-generated/endpoint_config.h

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions zzz_generated/light-switch-app/zap-generated/endpoint_config.h

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions zzz_generated/lighting-app/zap-generated/endpoint_config.h

Large diffs are not rendered by default.

236 changes: 118 additions & 118 deletions zzz_generated/lock-app/zap-generated/endpoint_config.h

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions zzz_generated/log-source-app/zap-generated/endpoint_config.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1978146

Please sign in to comment.