diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index d124ec9f98febe..5a74d4f7d42daf 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb # 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.02.03-nightly +ARG ZAP_VERSION=v2023.02.09-nightly # Ensure TARGETPLATFORM is set RUN case ${TARGETPLATFORM} in \ diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index d81441a69ab836..cc36b802380dc8 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.2.3' +MIN_ZAP_VERSION = '2023.2.9' class ZapTool: diff --git a/scripts/zap.json b/scripts/zap.json index 0ad4e76eb5121d..fa066ed9eb35cb 100644 --- a/scripts/zap.json +++ b/scripts/zap.json @@ -8,7 +8,7 @@ "mac-arm64", "windows-amd64" ], - "tags": ["version:2@v2023.02.03-nightly.1"] + "tags": ["version:2@v2023.02.09-nightly.1"] } ] } diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml new file mode 100644 index 00000000000000..063eadbb48e800 --- /dev/null +++ b/src/app/common/templates/config-data.yaml @@ -0,0 +1,77 @@ +LegacyStructs: + # List of structs for which we output a legacy definition in af-structs.h + # Ideally this list should become empty. + - CredentialStruct + +WeakEnums: + # Allow-list of enums that we generate as enums, not enum classes. + # The goal is to drive this down to 0. + - BarrierControlBarrierPosition + - BarrierControlMovingState + - ColorControlOptions + - ColorLoopAction + - ColorLoopDirection + - ColorMode + - ContentLaunchStatus + - ContentLaunchStreamingType + - EnhancedColorMode + - HardwareFaultEnum + - HueDirection + - HueMoveMode + - HueStepMode + - IdentifyEffectIdentifier + - IdentifyEffectVariant + - IdentifyIdentifyType + - InterfaceTypeEnum + - KeypadLockout + - LevelControlOptions + - MoveMode + - NetworkFaultEnum + - OnOffDelayedAllOffEffectVariant + - OnOffDyingLightEffectVariant + - OnOffEffectIdentifier + - PHYRateEnum + - RadioFaultEnum + - RoutingRole + - SaturationMoveMode + - SaturationStepMode + - SecurityType + - StatusCode + - StepMode + - TemperatureDisplayMode + - WiFiVersionType + +# We need a more configurable way of deciding which clusters have which init functions.... +# See https://github.com/project-chip/connectedhomeip/issues/4369 +ClustersWithInitFunctions: + - Basic + - Color Control + - Groups + - Identify + - Level Control + - Localization Configuration + - Occupancy Sensing + - On/Off + - Pump Configuration and Control + - Scenes + - Time Format Localization + - Thermostat + - Mode Select + +ClustersWithAttributeChangedFunctions: + - Bridged Device Basic + - Door Lock + - Identify + - Pump Configuration and Control + - Window Covering + - Fan Control + +ClustersWithPreAttributeChangeFunctions: + - Door Lock + - Pump Configuration and Control + - Thermostat User Interface Configuration + - Time Format Localization + - Localization Configuration + - Mode Select + - Fan Control + - Thermostat diff --git a/src/app/common/templates/legacy-struct-list.yaml b/src/app/common/templates/legacy-struct-list.yaml deleted file mode 100644 index a879485e168bdf..00000000000000 --- a/src/app/common/templates/legacy-struct-list.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# List of structs for which we output a legacy definition in af-structs.h -# Ideally this list should become empty. -- CredentialStruct diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index cf2a68d67af563..d03a81e11550bf 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -9,8 +9,7 @@ "templates/chip/helper.js" ], "resources": { - "weak-enum-list": "weak-enum-list.yaml", - "legacy-struct-list": "legacy-struct-list.yaml" + "config-data": "config-data.yaml" }, "override": "../../zap-templates/common/override.js", "partials": [ diff --git a/src/app/common/templates/weak-enum-list.yaml b/src/app/common/templates/weak-enum-list.yaml deleted file mode 100644 index 06501dff5f4f0c..00000000000000 --- a/src/app/common/templates/weak-enum-list.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Allow-list of enums that we generate as enums, not enum classes. The goal is -# to drive this down to 0. -- BarrierControlBarrierPosition -- BarrierControlMovingState -- ColorControlOptions -- ColorLoopAction -- ColorLoopDirection -- ColorMode -- ContentLaunchStatus -- ContentLaunchStreamingType -- EnhancedColorMode -- HardwareFaultEnum -- HueDirection -- HueMoveMode -- HueStepMode -- IdentifyEffectIdentifier -- IdentifyEffectVariant -- IdentifyIdentifyType -- InterfaceTypeEnum -- KeypadLockout -- LevelControlOptions -- MoveMode -- NetworkFaultEnum -- OnOffDelayedAllOffEffectVariant -- OnOffDyingLightEffectVariant -- OnOffEffectIdentifier -- PHYRateEnum -- RadioFaultEnum -- RoutingRole -- SaturationMoveMode -- SaturationStepMode -- SecurityType -- StatusCode -- StepMode -- TemperatureDisplayMode -- WiFiVersionType diff --git a/src/app/zap-templates/app-templates.json b/src/app/zap-templates/app-templates.json index e40007ce8e4313..94b6392d58f9df 100644 --- a/src/app/zap-templates/app-templates.json +++ b/src/app/zap-templates/app-templates.json @@ -9,6 +9,9 @@ "templates/app/helper.js", "templates/chip/helper.js" ], + "resources": { + "config-data": "../common/templates/config-data.yaml" + }, "override": "common/override.js", "partials": [ { diff --git a/src/app/zap-templates/templates/app/af-structs.zapt b/src/app/zap-templates/templates/app/af-structs.zapt index 1336de2ea491b7..1f42d91700e06c 100644 --- a/src/app/zap-templates/templates/app/af-structs.zapt +++ b/src/app/zap-templates/templates/app/af-structs.zapt @@ -15,7 +15,7 @@ {{#zcl_structs}} -{{#if (isLegacyStruct (asUnderlyingType label))}} +{{#if (isInConfigList (asUnderlyingType label) "LegacyStructs")}} {{#if itemCnt}} // Struct for {{label}} typedef struct _{{asType label}} { diff --git a/src/app/zap-templates/templates/app/cluster-enums-check.zapt b/src/app/zap-templates/templates/app/cluster-enums-check.zapt index 883a19b5cf0aee..e673a7af185278 100644 --- a/src/app/zap-templates/templates/app/cluster-enums-check.zapt +++ b/src/app/zap-templates/templates/app/cluster-enums-check.zapt @@ -13,7 +13,7 @@ static auto __attribute__((unused)) EnsureKnownEnumValue({{asUpperCamelCase ../n { using EnumType = {{asUpperCamelCase ../name}}::{{asType label}}; switch (val) { -{{#if (isWeaklyTypedEnum label)}} +{{#if (isInConfigList label "WeakEnums")}} // Need to convert consumers to using the new enum classes, so we // don't just have casts all over. #ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM @@ -21,7 +21,7 @@ static auto __attribute__((unused)) EnsureKnownEnumValue({{asUpperCamelCase ../n {{#zcl_enum_items}} case EnumType::k{{asUpperCamelCase label}}: {{/zcl_enum_items}} -{{#if (isWeaklyTypedEnum label)}} +{{#if (isInConfigList label "WeakEnums")}} #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM {{#zcl_enum_items}} case EMBER_ZCL_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}}: diff --git a/src/app/zap-templates/templates/app/cluster-enums.zapt b/src/app/zap-templates/templates/app/cluster-enums.zapt index 23e9a7c92ca888..4394ed79a7c25a 100644 --- a/src/app/zap-templates/templates/app/cluster-enums.zapt +++ b/src/app/zap-templates/templates/app/cluster-enums.zapt @@ -14,7 +14,7 @@ namespace Clusters { namespace {{asUpperCamelCase name}} { {{#zcl_enums}} -{{#if (isWeaklyTypedEnum label)}} +{{#if (isInConfigList label "WeakEnums")}} // Need to convert consumers to using the new enum classes, so we // don't just have casts all over. #ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM @@ -30,7 +30,7 @@ k{{asUpperCamelCase label}} = {{asHex value 2}}, // enum value. This specific should never be transmitted. kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}}, }; -{{#if (isWeaklyTypedEnum label)}} +{{#if (isInConfigList label "WeakEnums")}} #else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM using {{asType label}} = EmberAf{{asType label}}; static {{asType label}} __attribute__((unused)) k{{asType label}}kUnknownEnumValue = static_cast<{{asType label}}>({{first_unused_enum_value mode="first_unused"}}); diff --git a/src/app/zap-templates/templates/app/enums.zapt b/src/app/zap-templates/templates/app/enums.zapt index 0f70f759c4aeeb..8f0d5ba5287bdd 100644 --- a/src/app/zap-templates/templates/app/enums.zapt +++ b/src/app/zap-templates/templates/app/enums.zapt @@ -10,7 +10,7 @@ {{#zcl_enums}} {{#unless (isStrEqual label "Status")}} {{#unless (isStrEqual label "ReportingDirection")}} -{{#if (isWeaklyTypedEnum label)}} +{{#if (isInConfigList label "WeakEnums")}} // Enum for {{label}} enum EmberAf{{asType label}} : {{asUnderlyingZclType name}} {