From 449824077fb66f720f3d973be9c2c788bef9f374 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 1 Feb 2023 15:38:00 +0100 Subject: [PATCH] Update zap (#24757) * Update ZAP to v2023.01.31-nightly * Update generated content --- .../docker/images/chip-cert-bins/Dockerfile | 2 +- scripts/tools/zap/zap_execution.py | 2 +- scripts/zap.json | 2 +- .../tests/simulated-cluster-objects.h | 81 +++++++++++++++++++ 4 files changed, 84 insertions(+), 3 deletions(-) diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index 0514668098f7d2..b78d318e387d7a 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.01.19-nightly +ARG ZAP_VERSION=v2023.01.31-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 3705970571fada..5fd71df91d0bec 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.1.19' +MIN_ZAP_VERSION = '2023.1.31' class ZapTool: diff --git a/scripts/zap.json b/scripts/zap.json index a130ca65df7c0d..9275eacb9ae7d3 100644 --- a/scripts/zap.json +++ b/scripts/zap.json @@ -3,7 +3,7 @@ { "path": "fuchsia/third_party/zap/${platform}", "platforms": ["linux-amd64", "mac-amd64", "windows-amd64"], - "tags": ["version:2@v2023.01.19-nightly.1"] + "tags": ["version:2@v2023.01.31-nightly.1"] } ] } diff --git a/zzz_generated/app-common/app-common/zap-generated/tests/simulated-cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/tests/simulated-cluster-objects.h index 460fa781290575..8b02038206c5ec 100644 --- a/zzz_generated/app-common/app-common/zap-generated/tests/simulated-cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/tests/simulated-cluster-objects.h @@ -109,6 +109,81 @@ struct UnpairCommand } }; +struct GetCommissionerNodeIdCommand +{ + + CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const + { + chip::TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, chip::TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Decode(chip::TLV::TLVReader & reader) + { + CHIP_ERROR err = CHIP_NO_ERROR; + chip::TLV::TLVType outer; + VerifyOrReturnError(chip::TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(chip::TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (chip::TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; + } +}; + +struct GetCommissionerNodeIdResponse +{ + chip::NodeId nodeId; + + CHIP_ERROR Encode(chip::TLV::TLVWriter & writer, chip::TLV::Tag tag) const + { + chip::TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, chip::TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::ContextTag(0), nodeId)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Decode(chip::TLV::TLVReader & reader) + { + CHIP_ERROR err = CHIP_NO_ERROR; + chip::TLV::TLVType outer; + VerifyOrReturnError(chip::TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(chip::TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (chip::TLV::TagNumFromTag(reader.GetTag())) + { + case 0: + ReturnErrorOnFailure(chip::app::DataModel::Decode(reader, nodeId)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; + } +}; + struct WaitForMsCommand { uint32_t ms; @@ -1165,6 +1240,12 @@ using Type = struct PairWithCodeCommand; namespace Unpair { using Type = struct UnpairCommand; } +namespace GetCommissionerNodeId { +using Type = struct GetCommissionerNodeIdCommand; +} +namespace GetCommissionerNodeIdResponse { +using DecodableType = struct GetCommissionerNodeIdResponse; +} } // namespace Commands } // namespace CommissionerCommands