Skip to content

Commit

Permalink
Restrict the set of structs for which we generate legacy definitions. (
Browse files Browse the repository at this point in the history
…#24309)

* Restrict the set of structs for which we generate legacy definitions.

Most of the things in af-structs.h are not used, and fixing the names
of some of them causes bad name collisions due to lack of namespacing.
Just stop generating all of them except the ones we really use.

* Address review comment
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed May 9, 2023
1 parent f8cbea7 commit 2295768
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 584 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zap_regeneration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

runs-on: ubuntu-20.04
container:
image: connectedhomeip/chip-build:0.6.28
image: connectedhomeip/chip-build:0.6.30
defaults:
run:
shell: sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zap_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

runs-on: ubuntu-20.04
container:
image: connectedhomeip/chip-build:0.6.28
image: connectedhomeip/chip-build:0.6.30
defaults:
run:
shell: sh
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-cert-bins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG COMMITHASH=451e602649b8b37ba6c9aab8ba5e30747293f778
# ZAP Development install, so that it runs on both x64 and arm64
# Generally this should match with the ZAP version that is used for codegen within the
# specified SHA
ARG ZAP_VERSION=v2023.01.05-nightly
ARG ZAP_VERSION=v2023.01.06-nightly

# Ensure TARGETPLATFORM is set
RUN case ${TARGETPLATFORM} in \
Expand Down
4 changes: 4 additions & 0 deletions src/app/common/templates/legacy-struct-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# List of structs for which we output a legacy definition in af-structs.h
# Ideally this list should become empty.
- DlCredential
- ApplicationBasicApplication
3 changes: 2 additions & 1 deletion src/app/common/templates/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"templates/chip/helper.js"
],
"resources": {
"weak-enum-list": "weak-enum-list.yaml"
"weak-enum-list": "weak-enum-list.yaml",
"legacy-struct-list": "legacy-struct-list.yaml"
},
"override": "../../zap-templates/common/override.js",
"partials": [
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap-templates/templates/app/af-structs.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

{{#zcl_structs}}

{{#if (isLegacyStruct (asUnderlyingType label))}}
{{#if itemCnt}}
// Struct for {{label}}
typedef struct _{{asType label}} {
Expand All @@ -27,4 +28,5 @@ typedef struct _{{asType label}} {
// this will result in all the references to the data being as uint8_t*
typedef uint8_t {{asUnderlyingType label}};
{{/if}}
{{/if}}
{{/zcl_structs}}
Loading

0 comments on commit 2295768

Please sign in to comment.