From 9a35c4415a089ac8d26a7b876fb95fac2085796c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 11 Aug 2023 15:30:54 -0400 Subject: [PATCH 01/10] Revert "Make AddStatus generally VerifyOrDie and have centralized logging (#28634)" (#28661) --- src/app/CommandHandler.cpp | 46 +++++++++---------- src/app/CommandHandler.h | 27 +++++------ src/app/CommandResponseHelper.h | 2 +- .../barrier-control-server.cpp | 5 +- .../door-lock-server/door-lock-server.cpp | 11 +++-- .../door-lock-server/door-lock-server.h | 4 +- .../general-commissioning-server.cpp | 6 ++- .../group-key-mgmt-server.cpp | 24 +++++----- .../clusters/groups-server/groups-server.cpp | 6 ++- .../window-covering-server.cpp | 3 +- src/app/tests/TestCommandInteraction.cpp | 5 +- .../tests/data_model/TestCommands.cpp | 20 ++++---- 12 files changed, 84 insertions(+), 75 deletions(-) diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index cd67ffd59e436f..d291d8154d421f 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -272,7 +272,7 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint 0x%x", ChipLogValueMEI(concretePath.mCommandId), ChipLogValueMEI(concretePath.mClusterId), concretePath.mEndpointId); - return FallibleAddStatus(concretePath, commandExists) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return AddStatus(concretePath, commandExists) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } } @@ -287,10 +287,10 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem { if (err != CHIP_ERROR_ACCESS_DENIED) { - return FallibleAddStatus(concretePath, Status::Failure) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return AddStatus(concretePath, Status::Failure) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } // TODO: when wildcard invokes are supported, handle them to discard rather than fail with status - return FallibleAddStatus(concretePath, Status::UnsupportedAccess) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return AddStatus(concretePath, Status::UnsupportedAccess) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } } @@ -298,7 +298,7 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem { // TODO: when wildcard invokes are supported, discard a // wildcard-expanded path instead of returning a status. - return FallibleAddStatus(concretePath, Status::NeedsTimedInteraction) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return AddStatus(concretePath, Status::NeedsTimedInteraction) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } if (CommandIsFabricScoped(concretePath.mClusterId, concretePath.mCommandId)) @@ -312,7 +312,7 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem { // TODO: when wildcard invokes are supported, discard a // wildcard-expanded path instead of returning a status. - return FallibleAddStatus(concretePath, Status::UnsupportedAccess) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return AddStatus(concretePath, Status::UnsupportedAccess) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } } @@ -337,7 +337,7 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem exit: if (err != CHIP_NO_ERROR) { - return FallibleAddStatus(concretePath, Status::InvalidCommand) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return AddStatus(concretePath, Status::InvalidCommand) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } // We have handled the error status above and put the error status in response, now return success status so we can process @@ -468,31 +468,31 @@ CHIP_ERROR CommandHandler::AddStatusInternal(const ConcreteCommandPath & aComman return FinishStatus(); } -void CommandHandler::AddStatus(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus, - const char * context) +CHIP_ERROR CommandHandler::AddStatus(const ConcreteCommandPath & aCommandPath, const Status aStatus) { - - VerifyOrDie(FallibleAddStatus(aCommandPath, aStatus, context) == CHIP_NO_ERROR); + return AddStatusInternal(aCommandPath, StatusIB(aStatus)); } -CHIP_ERROR CommandHandler::FallibleAddStatus(const ConcreteCommandPath & path, const Protocols::InteractionModel::Status status, - const char * context) +void CommandHandler::AddStatusAndLogIfFailure(const ConcreteCommandPath & aCommandPath, const Status aStatus, const char * aMessage) { - - if (status != Status::Success) + if (aStatus != Status::Success) { - if (context == nullptr) - { - context = "no additional context"; - } - ChipLogError(DataManagement, - "Endpoint=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI " status " ChipLogFormatIMStatus " (%s)", - path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mCommandId), - ChipLogValueIMStatus(status), context); + "Failed to handle on Endpoint=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI + " with " ChipLogFormatIMStatus ": %s", + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId), + ChipLogValueIMStatus(aStatus), aMessage); } - return AddStatusInternal(path, StatusIB(status)); + CHIP_ERROR err = AddStatus(aCommandPath, aStatus); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DataManagement, + "Failed to set status on Endpoint=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI + ": %" CHIP_ERROR_FORMAT, + aCommandPath.mEndpointId, ChipLogValueMEI(aCommandPath.mClusterId), ChipLogValueMEI(aCommandPath.mCommandId), + err.Format()); + } } CHIP_ERROR CommandHandler::AddClusterSpecificSuccess(const ConcreteCommandPath & aCommandPath, ClusterStatus aClusterStatus) diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index 3c9a86c97b6052..bc96583abd7597 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -170,20 +170,13 @@ class CommandHandler : public Messaging::ExchangeDelegate */ void OnInvokeCommandRequest(Messaging::ExchangeContext * ec, const PayloadHeader & payloadHeader, System::PacketBufferHandle && payload, bool isTimedInvoke); + CHIP_ERROR AddStatus(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus); - /** - * Adds the given command status and returns any failures in adding statuses (e.g. out - * of buffer space) to the caller - */ - CHIP_ERROR FallibleAddStatus(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus, - const char * context = nullptr); - - /** - * Adds a status when the caller is unable to handle any failures. Logging is performed - * and failure to register the status is checked with VerifyOrDie. - */ - void AddStatus(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus, - const char * context = nullptr); + // Same as AddStatus, but logs that the command represented by aCommandPath failed with the given + // error status and error message, if aStatus is an error. Errors on AddStatus are just logged + // (since the caller likely can only log and not further add a status). + void AddStatusAndLogIfFailure(const ConcreteCommandPath & aCommandPath, const Protocols::InteractionModel::Status aStatus, + const char * aMessage); CHIP_ERROR AddClusterSpecificSuccess(const ConcreteCommandPath & aCommandPath, ClusterStatus aClusterStatus); @@ -245,9 +238,13 @@ class CommandHandler : public Messaging::ExchangeDelegate template void AddResponse(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData) { - if (AddResponseData(aRequestCommandPath, aData) != CHIP_NO_ERROR) + if (CHIP_NO_ERROR != AddResponseData(aRequestCommandPath, aData)) { - AddStatus(aRequestCommandPath, Protocols::InteractionModel::Status::Failure); + CHIP_ERROR err = AddStatus(aRequestCommandPath, Protocols::InteractionModel::Status::Failure); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DataManagement, "Failed to encode status: %" CHIP_ERROR_FORMAT, err.Format()); + } } } diff --git a/src/app/CommandResponseHelper.h b/src/app/CommandResponseHelper.h index 48d36d1ea82013..a85e92b72cc587 100644 --- a/src/app/CommandResponseHelper.h +++ b/src/app/CommandResponseHelper.h @@ -53,7 +53,7 @@ class CommandResponseHelper CHIP_ERROR Failure(Protocols::InteractionModel::Status aStatus) { - CHIP_ERROR err = mCommandHandler->FallibleAddStatus(mCommandPath, aStatus); + CHIP_ERROR err = mCommandHandler->AddStatus(mCommandPath, aStatus); if (err == CHIP_NO_ERROR) { mSentResponse = true; diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp index 645fc943078355..a7531aee1bcf91 100644 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp @@ -286,7 +286,10 @@ void emberAfBarrierControlClusterServerTickCallback(EndpointId endpoint) static void sendDefaultResponse(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, Status status) { - commandObj->AddStatus(commandPath, status); + if (commandObj->AddStatus(commandPath, status) != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to send default response"); + } } bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback( diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index a9b3cdd4dc106d..ad201e78cf7d2f 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -3314,20 +3314,23 @@ bool DoorLockServer::RemoteOperationEnabled(chip::EndpointId endpointId) const mode != OperatingModeEnum::kPrivacy && mode != OperatingModeEnum::kNoRemoteLockUnlock; } -void DoorLockServer::sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - EmberAfStatus status) +CHIP_ERROR DoorLockServer::sendClusterResponse(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, EmberAfStatus status) { VerifyOrDie(nullptr != commandObj); + auto err = CHIP_NO_ERROR; auto statusAsInteger = to_underlying(status); if (statusAsInteger == to_underlying(DlStatus::kOccupied) || statusAsInteger == to_underlying(DlStatus::kDuplicate)) { - VerifyOrDie(commandObj->AddClusterSpecificFailure(commandPath, static_cast(status)) == CHIP_NO_ERROR); + err = commandObj->AddClusterSpecificFailure(commandPath, static_cast(status)); } else { - commandObj->AddStatus(commandPath, ToInteractionModelStatus(status)); + err = commandObj->AddStatus(commandPath, ToInteractionModelStatus(status)); } + + return err; } EmberAfDoorLockEndpointContext * DoorLockServer::getContext(chip::EndpointId endpointId) diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h index 70988c17786964..212c374077298f 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.h +++ b/src/app/clusters/door-lock-server/door-lock-server.h @@ -422,8 +422,8 @@ class DoorLockServer bool engageLockout(chip::EndpointId endpointId); - static void sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - EmberAfStatus status); + static CHIP_ERROR sendClusterResponse(chip::app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, EmberAfStatus status); /** * @brief Common handler for LockDoor, UnlockDoor, UnlockWithTimeout commands diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 536ac205454862..ef66957d754d68 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -50,7 +50,11 @@ using Transport::Session; { \ if (!::chip::ChipError::IsSuccess(expr)) \ { \ - commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::code, #expr); \ + CHIP_ERROR statusErr = commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::code); \ + if (statusErr != CHIP_NO_ERROR) \ + { \ + ChipLogError(Zcl, "%s: %" CHIP_ERROR_FORMAT, #expr, statusErr.Format()); \ + } \ return true; \ } \ } while (false) diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index f4da9238611528..fcd0dfa1353516 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -414,13 +414,13 @@ bool GetProviderAndFabric(chip::app::CommandHandler * commandObj, const chip::ap if (nullptr == provider) { - commandObj->AddStatus(commandPath, Status::Failure, "Internal consistency error on provider!"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::Failure, "Internal consistency error on provider!"); return false; } if (nullptr == fabric) { - commandObj->AddStatus(commandPath, Status::Failure, "Internal consistency error on access fabric!"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::Failure, "Internal consistency error on access fabric!"); return false; } @@ -460,7 +460,7 @@ bool emberAfGroupKeyManagementClusterKeySetWriteCallback( Status status = ValidateKeySetWriteArguments(commandData); if (status != Status::Success) { - commandObj->AddStatus(commandPath, status, "Failure to validate KeySet data dependencies."); + commandObj->AddStatusAndLogIfFailure(commandPath, status, "Failure to validate KeySet data dependencies."); return true; } @@ -470,7 +470,8 @@ bool emberAfGroupKeyManagementClusterKeySetWriteCallback( // supported by the server, because it is ... a new value unrecognized // by a legacy server, then the server SHALL generate a general // constraint error - commandObj->AddStatus(commandPath, Status::ConstraintError, "Received unknown GroupKeySecurityPolicyEnum value"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::ConstraintError, + "Received unknown GroupKeySecurityPolicyEnum value"); return true; } @@ -481,8 +482,8 @@ bool emberAfGroupKeyManagementClusterKeySetWriteCallback( // any action attempting to set CacheAndSync in the // GroupKeySecurityPolicy field SHALL fail with an INVALID_COMMAND // error. - commandObj->AddStatus(commandPath, Status::InvalidCommand, - "Received a CacheAndSync GroupKeySecurityPolicyEnum when MCSP not supported"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::InvalidCommand, + "Received a CacheAndSync GroupKeySecurityPolicyEnum when MCSP not supported"); return true; } @@ -528,7 +529,7 @@ bool emberAfGroupKeyManagementClusterKeySetWriteCallback( err = provider->SetKeySet(fabric->GetFabricIndex(), compressed_fabric_id, keyset); if (CHIP_ERROR_INVALID_LIST_LENGTH == err) { - commandObj->AddStatus(commandPath, Status::ResourceExhausted, "Not enough space left to add a new KeySet"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::ResourceExhausted, "Not enough space left to add a new KeySet"); return true; } @@ -564,7 +565,7 @@ bool emberAfGroupKeyManagementClusterKeySetReadCallback( if (CHIP_NO_ERROR != provider->GetKeySet(fabricIndex, commandData.groupKeySetID, keyset)) { // KeySet ID not found - commandObj->AddStatus(commandPath, Status::NotFound, "Keyset ID not found in KeySetRead"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::NotFound, "Keyset ID not found in KeySetRead"); return true; } @@ -628,7 +629,8 @@ bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( { // SPEC: This command SHALL fail with an INVALID_COMMAND status code back to the initiator if the GroupKeySetID being // removed is 0, which is the Key Set associated with the Identity Protection Key (IPK). - commandObj->AddStatus(commandPath, Status::InvalidCommand, "Attempted to KeySetRemove the identity protection key!"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::InvalidCommand, + "Attempted to KeySetRemove the identity protection key!"); return true; } @@ -647,7 +649,7 @@ bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( } // Send status response. - commandObj->AddStatus(commandPath, status, "KeySetRemove failed"); + commandObj->AddStatusAndLogIfFailure(commandPath, status, "KeySetRemove failed"); return true; } @@ -699,7 +701,7 @@ bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback( auto keysIt = provider->IterateKeySets(fabricIndex); if (nullptr == keysIt) { - commandObj->AddStatus(commandPath, Status::Failure, "Failed iteration of key set indices!"); + commandObj->AddStatusAndLogIfFailure(commandPath, Status::Failure, "Failed iteration of key set indices!"); return true; } diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index ccb4fb1d439a72..00196ad94c9419 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -351,7 +351,11 @@ bool emberAfGroupsClusterAddGroupIfIdentifyingCallback(app::CommandHandler * com status = GroupAdd(fabricIndex, endpointId, groupId, groupName); } - commandObj->AddStatus(commandPath, status); + CHIP_ERROR sendErr = commandObj->AddStatus(commandPath, status); + if (CHIP_NO_ERROR != sendErr) + { + ChipLogDetail(Zcl, "Groups: failed to send %s: %" CHIP_ERROR_FORMAT, "status_response", sendErr.Format()); + } return true; } diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index a78a3d138bbd39..2bdd972cd634f7 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -771,8 +771,7 @@ bool emberAfWindowCoveringClusterStopMotionCallback(app::CommandHandler * comman } } - commandObj->AddStatus(commandPath, Status::Success); - return true; + return CHIP_NO_ERROR == commandObj->AddStatus(commandPath, Status::Success); } /** diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index 14418aecc2877a..d90ce4d97b3d7c 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -1095,8 +1095,9 @@ void TestCommandInteraction::TestCommandHandlerCommandEncodeExternalFailure(nlTe err = commandHandler.AddResponseData(ConcreteCommandPath(path.mEndpointId, path.mClusterId, path.mCommandId), BadFields()); NL_TEST_ASSERT(apSuite, err != CHIP_NO_ERROR); - commandHandler.AddStatus(ConcreteCommandPath(path.mEndpointId, path.mClusterId, path.mCommandId), - Protocols::InteractionModel::Status::Failure); + err = commandHandler.AddStatus(ConcreteCommandPath(path.mEndpointId, path.mClusterId, path.mCommandId), + Protocols::InteractionModel::Status::Failure); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = commandHandler.Finalize(commandPacket); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); diff --git a/src/controller/tests/data_model/TestCommands.cpp b/src/controller/tests/data_model/TestCommands.cpp index 0cb30647b6da4e..f9d1e35a900b73 100644 --- a/src/controller/tests/data_model/TestCommands.cpp +++ b/src/controller/tests/data_model/TestCommands.cpp @@ -85,7 +85,8 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip if (DataModel::Decode(aReader, dataRequest) != CHIP_NO_ERROR) { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::Failure, "Unable to decode the request"); + apCommandObj->AddStatusAndLogIfFailure(aCommandPath, Protocols::InteractionModel::Status::Failure, + "Unable to decode the request"); return; } @@ -115,18 +116,15 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip } else if (responseDirective == kSendMultipleSuccessStatusCodes) { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::Success, - "No error but testing status success case"); - // TODO: Right now all but the first AddStatus call fail, so this // test is not really testing what it should. - for (size_t i = 0; i < 3; ++i) + for (size_t i = 0; i < 4; ++i) { - (void) apCommandObj->FallibleAddStatus(aCommandPath, Protocols::InteractionModel::Status::Success, - "No error but testing status success case"); + apCommandObj->AddStatusAndLogIfFailure(aCommandPath, Protocols::InteractionModel::Status::Success, + "No error but testing AddStatusAndLogIfFailure in success case"); } // And one failure on the end. - (void) apCommandObj->FallibleAddStatus(aCommandPath, Protocols::InteractionModel::Status::Failure); + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::Failure); } else if (responseDirective == kSendError) { @@ -134,13 +132,11 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, chip } else if (responseDirective == kSendMultipleErrors) { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::Failure); - // TODO: Right now all but the first AddStatus call fail, so this // test is not really testing what it should. - for (size_t i = 0; i < 3; ++i) + for (size_t i = 0; i < 4; ++i) { - (void) apCommandObj->FallibleAddStatus(aCommandPath, Protocols::InteractionModel::Status::Failure); + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::Failure); } } else if (responseDirective == kSendSuccessStatusCodeWithClusterStatus) From a341f2a1a3b26ccbe73a6504c20e93e7da3ddae1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 11 Aug 2023 17:33:23 -0400 Subject: [PATCH 02/10] Align Data Model and Interaction Model revisions with spec. (#28645) --- src/app/DataModelRevision.h | 5 ++++- src/app/InteractionModelRevision.h | 5 ++++- src/app/tests/suites/TestCASERecovery.yaml | 4 ++-- zzz_generated/chip-tool/zap-generated/test/Commands.h | 4 ++-- .../darwin-framework-tool/zap-generated/test/Commands.h | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/DataModelRevision.h b/src/app/DataModelRevision.h index a476b32c93b1c8..47ecb626a13ffa 100644 --- a/src/app/DataModelRevision.h +++ b/src/app/DataModelRevision.h @@ -22,7 +22,10 @@ * * A monotonic number identifying the revision number of the Data Model against * which the Node is certified. + * + * See section 7.1.1. "Revision History" in the "Data Model Specification" + * chapter of the core Matter specification. */ #ifndef CHIP_DEVICE_DATA_MODEL_REVISION -#define CHIP_DEVICE_DATA_MODEL_REVISION 1 +#define CHIP_DEVICE_DATA_MODEL_REVISION 17 #endif diff --git a/src/app/InteractionModelRevision.h b/src/app/InteractionModelRevision.h index 8f38a342969ddd..7e92d7c2d58aba 100644 --- a/src/app/InteractionModelRevision.h +++ b/src/app/InteractionModelRevision.h @@ -24,9 +24,12 @@ * CHIP_DEVICE_INTERACTION_MODEL_REVISION * * A monothonic number identifying the interaction model revision. + * + * See section 8.1.1. "Revision History" in the "Interaction Model + * Specification" chapter of the core Matter specification. */ #ifndef CHIP_DEVICE_INTERACTION_MODEL_REVISION -#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 1 +#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 10 #endif constexpr uint8_t kInteractionModelRevisionTag = 0xFF; diff --git a/src/app/tests/suites/TestCASERecovery.yaml b/src/app/tests/suites/TestCASERecovery.yaml index 69ecf23a9f50fe..ef72e4dff7e512 100644 --- a/src/app/tests/suites/TestCASERecovery.yaml +++ b/src/app/tests/suites/TestCASERecovery.yaml @@ -33,7 +33,7 @@ tests: command: "readAttribute" attribute: "DataModelRevision" response: - value: 1 + value: 17 - label: "Reboot the server" cluster: "SystemCommands" @@ -72,4 +72,4 @@ tests: command: "readAttribute" attribute: "DataModelRevision" response: - value: 1 + value: 17 diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index c66cad9e1d95c8..0905fdf3599b2b 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -81101,7 +81101,7 @@ class TestCASERecoverySuite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("dataModelRevision", value, 1U)); + VerifyOrReturn(CheckValue("dataModelRevision", value, 17U)); } break; case 2: @@ -81124,7 +81124,7 @@ class TestCASERecoverySuite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("dataModelRevision", value, 1U)); + VerifyOrReturn(CheckValue("dataModelRevision", value, 17U)); } break; default: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index feeeed0da0bc56..e9f65d53c9e541 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -117246,7 +117246,7 @@ class TestCASERecovery : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("DataModelRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("DataModelRevision", actualValue, 17U)); } NextTest(); @@ -117315,7 +117315,7 @@ class TestCASERecovery : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("DataModelRevision", actualValue, 1U)); + VerifyOrReturn(CheckValue("DataModelRevision", actualValue, 17U)); } NextTest(); From 8d1dcf6bcfbfa6a40ffed21629579f105e9c62e6 Mon Sep 17 00:00:00 2001 From: abeck-whirlpool <129295708+abeck-whirlpool@users.noreply.github.com> Date: Fri, 11 Aug 2023 18:34:55 -0500 Subject: [PATCH 03/10] Adding laundry washer controls to all clusters (#28616) Co-authored-by: abeck-riis <98488327+abeck-riis@users.noreply.github.com> --- .../all-clusters-app.matter | 39 ++ .../all-clusters-common/all-clusters-app.zap | 332 +++++++++++++- .../esp32/main/CMakeLists.txt | 1 + ...olClusterAccessControlEntryChangedEvent.kt | 99 ++--- ...usterAccessControlExtensionChangedEvent.kt | 99 ++--- .../ActionsClusterActionFailedEvent.kt | 21 +- .../ActionsClusterStateChangedEvent.kt | 15 +- .../BasicInformationClusterLeaveEvent.kt | 13 +- ...InformationClusterReachableChangedEvent.kt | 13 +- .../BasicInformationClusterStartUpEvent.kt | 13 +- .../BooleanStateClusterStateChangeEvent.kt | 13 +- ...InformationClusterReachableChangedEvent.kt | 16 +- ...viceBasicInformationClusterStartUpEvent.kt | 13 +- .../DishwasherAlarmClusterNotifyEvent.kt | 21 +- .../DoorLockClusterDoorLockAlarmEvent.kt | 13 +- .../DoorLockClusterDoorStateChangeEvent.kt | 13 +- .../DoorLockClusterLockOperationErrorEvent.kt | 159 +++---- .../DoorLockClusterLockOperationEvent.kt | 156 +++---- .../DoorLockClusterLockUserChangeEvent.kt | 121 +++--- ...eneralDiagnosticsClusterBootReasonEvent.kt | 13 +- ...gnosticsClusterHardwareFaultChangeEvent.kt | 46 +- ...agnosticsClusterNetworkFaultChangeEvent.kt | 46 +- ...DiagnosticsClusterRadioFaultChangeEvent.kt | 46 +- ...nalStateClusterOperationCompletionEvent.kt | 94 ++-- ...tionalStateClusterOperationalErrorEvent.kt | 21 +- ...pdateRequestorClusterDownloadErrorEvent.kt | 73 ++-- ...ateRequestorClusterStateTransitionEvent.kt | 52 +-- ...dateRequestorClusterVersionAppliedEvent.kt | 20 +- ...rSourceClusterBatChargeFaultChangeEvent.kt | 43 +- .../PowerSourceClusterBatFaultChangeEvent.kt | 43 +- ...PowerSourceClusterWiredFaultChangeEvent.kt | 43 +- .../RefrigeratorAlarmClusterNotifyEvent.kt | 21 +- ...nalStateClusterOperationCompletionEvent.kt | 97 ++--- ...tionalStateClusterOperationalErrorEvent.kt | 21 +- .../SmokeCoAlarmClusterCOAlarmEvent.kt | 13 +- ...eCoAlarmClusterInterconnectCOAlarmEvent.kt | 13 +- ...AlarmClusterInterconnectSmokeAlarmEvent.kt | 13 +- .../SmokeCoAlarmClusterLowBatteryEvent.kt | 13 +- .../SmokeCoAlarmClusterSmokeAlarmEvent.kt | 13 +- ...areDiagnosticsClusterSoftwareFaultEvent.kt | 52 +-- .../SwitchClusterInitialPressEvent.kt | 13 +- .../SwitchClusterLongPressEvent.kt | 13 +- .../SwitchClusterLongReleaseEvent.kt | 13 +- .../SwitchClusterMultiPressCompleteEvent.kt | 20 +- .../SwitchClusterMultiPressOngoingEvent.kt | 20 +- .../SwitchClusterShortReleaseEvent.kt | 13 +- .../SwitchClusterSwitchLatchedEvent.kt | 13 +- ...DiagnosticsClusterConnectionStatusEvent.kt | 16 +- ...agnosticsClusterNetworkFaultChangeEvent.kt | 49 +-- ...imeSynchronizationClusterDSTStatusEvent.kt | 13 +- ...nchronizationClusterTimeZoneStatusEvent.kt | 30 +- .../UnitTestingClusterTestEventEvent.kt | 65 ++- ...estingClusterTestFabricScopedEventEvent.kt | 13 +- ...agnosticsClusterAssociationFailureEvent.kt | 20 +- ...DiagnosticsClusterConnectionStatusEvent.kt | 16 +- ...orkDiagnosticsClusterDisconnectionEvent.kt | 13 +- ...sControlClusterAccessControlEntryStruct.kt | 108 +++-- ...trolClusterAccessControlExtensionStruct.kt | 14 +- ...ControlClusterAccessControlTargetStruct.kt | 82 ++-- .../structs/ActionsClusterActionStruct.kt | 34 +- .../ActionsClusterEndpointListStruct.kt | 35 +- ...nitoringClusterReplacementProductStruct.kt | 28 +- ...pplicationBasicClusterApplicationStruct.kt | 17 +- ...ationLauncherClusterApplicationEPStruct.kt | 39 +- ...icationLauncherClusterApplicationStruct.kt | 17 +- .../AudioOutputClusterOutputInfoStruct.kt | 15 +- ...nformationClusterCapabilityMinimaStruct.kt | 25 +- ...formationClusterProductAppearanceStruct.kt | 35 +- .../structs/BindingClusterTargetStruct.kt | 90 ++-- ...formationClusterProductAppearanceStruct.kt | 41 +- .../ChannelClusterChannelInfoStruct.kt | 81 ++-- .../structs/ChannelClusterLineupInfoStruct.kt | 54 +-- ...tentLauncherClusterAdditionalInfoStruct.kt | 14 +- ...auncherClusterBrandingInformationStruct.kt | 143 +++--- ...ntentLauncherClusterContentSearchStruct.kt | 29 +- .../ContentLauncherClusterDimensionStruct.kt | 19 +- .../ContentLauncherClusterParameterStruct.kt | 54 ++- ...ntLauncherClusterStyleInformationStruct.kt | 71 ++- .../DescriptorClusterDeviceTypeStruct.kt | 14 +- .../DescriptorClusterSemanticTagStruct.kt | 76 ++-- .../DishwasherModeClusterModeOptionStruct.kt | 33 +- .../DishwasherModeClusterModeTagStruct.kt | 30 +- .../DoorLockClusterCredentialStruct.kt | 14 +- .../structs/FixedLabelClusterLabelStruct.kt | 14 +- ...missioningClusterBasicCommissioningInfo.kt | 28 +- ...neralDiagnosticsClusterNetworkInterface.kt | 117 +++-- ...pKeyManagementClusterGroupInfoMapStruct.kt | 51 ++- ...upKeyManagementClusterGroupKeyMapStruct.kt | 19 +- ...upKeyManagementClusterGroupKeySetStruct.kt | 169 ++++---- ...nitoringClusterReplacementProductStruct.kt | 28 +- ...mentClusterMonitoringRegistrationStruct.kt | 28 +- ...aundryWasherModeClusterModeOptionStruct.kt | 33 +- .../LaundryWasherModeClusterModeTagStruct.kt | 30 +- .../MediaInputClusterInputInfoStruct.kt | 21 +- ...iaPlaybackClusterPlaybackPositionStruct.kt | 35 +- .../ModeSelectClusterModeOptionStruct.kt | 33 +- .../ModeSelectClusterSemanticTagStruct.kt | 14 +- ...rkCommissioningClusterNetworkInfoStruct.kt | 17 +- ...gClusterThreadInterfaceScanResultStruct.kt | 43 +- ...ingClusterWiFiInterfaceScanResultStruct.kt | 37 +- ...redentialsClusterFabricDescriptorStruct.kt | 37 +- .../OperationalCredentialsClusterNOCStruct.kt | 40 +- ...OperationalStateClusterErrorStateStruct.kt | 58 ++- ...ionalStateClusterOperationalStateStruct.kt | 38 +- ...eUpdateRequestorClusterProviderLocation.kt | 25 +- ...erSourceClusterBatChargeFaultChangeType.kt | 43 +- .../PowerSourceClusterBatFaultChangeType.kt | 43 +- .../PowerSourceClusterWiredFaultChangeType.kt | 43 +- ...olledCabinetModeClusterModeOptionStruct.kt | 47 +- ...ntrolledCabinetModeClusterModeTagStruct.kt | 36 +- .../RvcCleanModeClusterModeOptionStruct.kt | 33 +- .../RvcCleanModeClusterModeTagStruct.kt | 30 +- ...OperationalStateClusterErrorStateStruct.kt | 58 ++- ...ionalStateClusterOperationalStateStruct.kt | 38 +- .../RvcRunModeClusterModeOptionStruct.kt | 33 +- .../structs/RvcRunModeClusterModeTagStruct.kt | 30 +- .../ScenesClusterAttributeValuePair.kt | 14 +- .../structs/ScenesClusterExtensionFieldSet.kt | 31 +- ...reDiagnosticsClusterThreadMetricsStruct.kt | 98 ++--- .../TargetNavigatorClusterTargetInfoStruct.kt | 14 +- ...statClusterThermostatScheduleTransition.kt | 67 ++- ...rkDiagnosticsClusterNeighborTableStruct.kt | 103 ++--- ...ticsClusterOperationalDatasetComponents.kt | 70 ++- ...tworkDiagnosticsClusterRouteTableStruct.kt | 46 +- ...NetworkDiagnosticsClusterSecurityPolicy.kt | 14 +- ...meSynchronizationClusterDSTOffsetStruct.kt | 40 +- ...sterFabricScopedTrustedTimeSourceStruct.kt | 20 +- ...imeSynchronizationClusterTimeZoneStruct.kt | 35 +- ...onizationClusterTrustedTimeSourceStruct.kt | 19 +- ...nitTestingClusterDoubleNestedStructList.kt | 27 +- .../structs/UnitTestingClusterNestedStruct.kt | 19 +- .../UnitTestingClusterNestedStructList.kt | 86 ++-- ...stingClusterNullablesAndOptionalsStruct.kt | 410 ++++++++---------- .../structs/UnitTestingClusterSimpleStruct.kt | 29 +- .../UnitTestingClusterTestFabricScoped.kt | 145 +++---- .../UnitTestingClusterTestListStructOctet.kt | 14 +- .../structs/UserLabelClusterLabelStruct.kt | 14 +- 137 files changed, 3221 insertions(+), 2961 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 4510215cc4fa80..d3593cf9564395 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2589,6 +2589,32 @@ server cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } +/** This cluster supports remotely monitoring and controling the different typs of functionality available to a washing device, such as a washing machine. */ +server cluster LaundryWasherControls = 83 { + enum NumberOfRinsesEnum : ENUM8 { + kNone = 0; + kNormal = 1; + kExtra = 2; + kMax = 3; + } + + bitmap Feature : BITMAP32 { + kSpin = 0x1; + kRinse = 0x2; + } + + readonly attribute CHAR_STRING spinSpeeds[] = 0; + attribute nullable int8u spinSpeedCurrent = 1; + attribute NumberOfRinsesEnum numberOfRinses = 2; + readonly attribute NumberOfRinsesEnum supportedRinses[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcRunMode = 84 { enum ModeTag : ENUM16 { @@ -6621,6 +6647,19 @@ endpoint 1 { ram attribute clusterRevision default = 1; } + server cluster LaundryWasherControls { + callback attribute spinSpeeds; + ram attribute spinSpeedCurrent; + ram attribute numberOfRinses; + callback attribute supportedRinses; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + } + server cluster RvcRunMode { callback attribute supportedModes; callback attribute currentMode; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index f7983bd036f737..c3580af95b8741 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -33,7 +33,33 @@ ], "endpointTypes": [ { + "id": 13, "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 177, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 177, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 177 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], "deviceTypeName": "MA-rootdevice", "deviceTypeCode": 22, "deviceTypeProfileId": 259, @@ -9480,7 +9506,33 @@ ] }, { + "id": 16, "name": "MA-onofflight", + "deviceTypeRef": { + "id": 183, + "code": 256, + "profileId": 259, + "label": "MA-onofflight", + "name": "MA-onofflight" + }, + "deviceTypes": [ + { + "id": 183, + "code": 256, + "profileId": 259, + "label": "MA-onofflight", + "name": "MA-onofflight" + } + ], + "deviceTypeRefs": [ + 183 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 256 + ], "deviceTypeName": "MA-onofflight", "deviceTypeCode": 256, "deviceTypeProfileId": 259, @@ -14017,6 +14069,218 @@ } ] }, + { + "name": "Laundry Washer Controls", + "code": 83, + "mfgCode": null, + "define": "LAUNDRY_WASHER_CONTROLS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Laundry Washer Controls", + "code": 83, + "mfgCode": null, + "define": "LAUNDRY_WASHER_CONTROLS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "SpinSpeeds", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpinSpeedCurrent", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfRinses", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "NumberOfRinsesEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedRinses", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "RVC Run Mode", "code": 84, @@ -28933,7 +29197,33 @@ ] }, { + "id": 15, "name": "MA-onofflight", + "deviceTypeRef": { + "id": 183, + "code": 256, + "profileId": 259, + "label": "MA-onofflight", + "name": "MA-onofflight" + }, + "deviceTypes": [ + { + "id": 183, + "code": 256, + "profileId": 259, + "label": "MA-onofflight", + "name": "MA-onofflight" + } + ], + "deviceTypeRefs": [ + 183 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 256 + ], "deviceTypeName": "MA-onofflight", "deviceTypeCode": 256, "deviceTypeProfileId": 259, @@ -32539,7 +32829,33 @@ ] }, { + "id": 14, "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 228, + "code": 61442, + "profileId": 259, + "label": "MA-secondary-network-commissioning", + "name": "MA-secondary-network-commissioning" + }, + "deviceTypes": [ + { + "id": 228, + "code": 61442, + "profileId": 259, + "label": "MA-secondary-network-commissioning", + "name": "MA-secondary-network-commissioning" + } + ], + "deviceTypeRefs": [ + 228 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 61442 + ], "deviceTypeName": "MA-secondary-network-commissioning", "deviceTypeCode": 61442, "deviceTypeProfileId": 259, @@ -33021,36 +33337,28 @@ "endpointTypeIndex": 0, "profileId": 259, "endpointId": 0, - "networkId": 0, - "endpointVersion": 1, - "deviceIdentifier": 22 + "networkId": 0 }, { "endpointTypeName": "MA-onofflight", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, - "networkId": 0, - "endpointVersion": 1, - "deviceIdentifier": 256 + "networkId": 0 }, { "endpointTypeName": "MA-onofflight", "endpointTypeIndex": 2, "profileId": 259, "endpointId": 2, - "networkId": 0, - "endpointVersion": 1, - "deviceIdentifier": 256 + "networkId": 0 }, { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 3, "profileId": 259, "endpointId": 65534, - "networkId": 0, - "endpointVersion": 1, - "deviceIdentifier": 61442 + "networkId": 0 } ], "log": [] diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index b5435325459417..caacc1c5b2acfb 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -96,6 +96,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/dishwasher-alarm-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" ) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt index e926e70d861c20..338c93d265e2c2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt @@ -17,20 +17,22 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class AccessControlClusterAccessControlEntryChangedEvent( - val adminNodeID: Long?, - val adminPasscodeID: Int?, - val changeType: Int, - val latestValue: - chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct?, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class AccessControlClusterAccessControlEntryChangedEvent ( + val adminNodeID: Long?, + val adminPasscodeID: Int?, + val changeType: Int, + val latestValue: chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct?, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlEntryChangedEvent {\n") append("\tadminNodeID : $adminNodeID\n") append("\tadminPasscodeID : $adminPasscodeID\n") @@ -44,21 +46,21 @@ class AccessControlClusterAccessControlEntryChangedEvent( tlvWriter.apply { startStructure(tag) if (adminNodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } if (adminPasscodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } put(ContextSpecificTag(TAG_CHANGE_TYPE), changeType) if (latestValue != null) { - latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) - } else { - putNull(ContextSpecificTag(TAG_LATEST_VALUE)) - } + latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) + } else { + putNull(ContextSpecificTag(TAG_LATEST_VALUE)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -71,45 +73,32 @@ class AccessControlClusterAccessControlEntryChangedEvent( private const val TAG_LATEST_VALUE = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): AccessControlClusterAccessControlEntryChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlEntryChangedEvent { tlvReader.enterStructure(tag) - val adminNodeID = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - null - } - val adminPasscodeID = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - null - } + val adminNodeID = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + null + } + val adminPasscodeID = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + null + } val changeType = tlvReader.getInt(ContextSpecificTag(TAG_CHANGE_TYPE)) - val latestValue = - if (!tlvReader.isNull()) { - chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct - .fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) - null - } + val latestValue = if (!tlvReader.isNull()) { + chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return AccessControlClusterAccessControlEntryChangedEvent( - adminNodeID, - adminPasscodeID, - changeType, - latestValue, - fabricIndex - ) + return AccessControlClusterAccessControlEntryChangedEvent(adminNodeID, adminPasscodeID, changeType, latestValue, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt index e01b81cec705bb..064b86812956d4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt @@ -17,20 +17,22 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class AccessControlClusterAccessControlExtensionChangedEvent( - val adminNodeID: Long?, - val adminPasscodeID: Int?, - val changeType: Int, - val latestValue: - chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct?, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class AccessControlClusterAccessControlExtensionChangedEvent ( + val adminNodeID: Long?, + val adminPasscodeID: Int?, + val changeType: Int, + val latestValue: chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct?, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlExtensionChangedEvent {\n") append("\tadminNodeID : $adminNodeID\n") append("\tadminPasscodeID : $adminPasscodeID\n") @@ -44,21 +46,21 @@ class AccessControlClusterAccessControlExtensionChangedEvent( tlvWriter.apply { startStructure(tag) if (adminNodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } if (adminPasscodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } put(ContextSpecificTag(TAG_CHANGE_TYPE), changeType) if (latestValue != null) { - latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) - } else { - putNull(ContextSpecificTag(TAG_LATEST_VALUE)) - } + latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) + } else { + putNull(ContextSpecificTag(TAG_LATEST_VALUE)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -71,45 +73,32 @@ class AccessControlClusterAccessControlExtensionChangedEvent( private const val TAG_LATEST_VALUE = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): AccessControlClusterAccessControlExtensionChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlExtensionChangedEvent { tlvReader.enterStructure(tag) - val adminNodeID = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - null - } - val adminPasscodeID = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - null - } + val adminNodeID = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + null + } + val adminPasscodeID = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + null + } val changeType = tlvReader.getInt(ContextSpecificTag(TAG_CHANGE_TYPE)) - val latestValue = - if (!tlvReader.isNull()) { - chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct - .fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) - null - } + val latestValue = if (!tlvReader.isNull()) { + chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return AccessControlClusterAccessControlExtensionChangedEvent( - adminNodeID, - adminPasscodeID, - changeType, - latestValue, - fabricIndex - ) + return AccessControlClusterAccessControlExtensionChangedEvent(adminNodeID, adminPasscodeID, changeType, latestValue, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt index d2e375338f705d..167cdbeaebfee4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ActionsClusterActionFailedEvent( - val actionID: Int, - val invokeID: Long, - val newState: Int, - val error: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ActionsClusterActionFailedEvent ( + val actionID: Int, + val invokeID: Long, + val newState: Int, + val error: Int) { + override fun toString(): String = buildString { append("ActionsClusterActionFailedEvent {\n") append("\tactionID : $actionID\n") append("\tinvokeID : $invokeID\n") @@ -54,13 +57,13 @@ class ActionsClusterActionFailedEvent( private const val TAG_NEW_STATE = 2 private const val TAG_ERROR = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterActionFailedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterActionFailedEvent { tlvReader.enterStructure(tag) val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D)) val invokeID = tlvReader.getLong(ContextSpecificTag(TAG_INVOKE_I_D)) val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE)) val error = tlvReader.getInt(ContextSpecificTag(TAG_ERROR)) - + tlvReader.exitContainer() return ActionsClusterActionFailedEvent(actionID, invokeID, newState, error) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt index 05ad68aae272ea..cd461b0ff538ef 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt @@ -17,13 +17,20 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ActionsClusterStateChangedEvent(val actionID: Int, val invokeID: Long, val newState: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class ActionsClusterStateChangedEvent ( + val actionID: Int, + val invokeID: Long, + val newState: Int) { + override fun toString(): String = buildString { append("ActionsClusterStateChangedEvent {\n") append("\tactionID : $actionID\n") append("\tinvokeID : $invokeID\n") @@ -46,12 +53,12 @@ class ActionsClusterStateChangedEvent(val actionID: Int, val invokeID: Long, val private const val TAG_INVOKE_I_D = 1 private const val TAG_NEW_STATE = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterStateChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterStateChangedEvent { tlvReader.enterStructure(tag) val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D)) val invokeID = tlvReader.getLong(ContextSpecificTag(TAG_INVOKE_I_D)) val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE)) - + tlvReader.exitContainer() return ActionsClusterStateChangedEvent(actionID, invokeID, newState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt index 962ed26cddb40d..e45d705386325c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BasicInformationClusterLeaveEvent(val fabricIndex: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class BasicInformationClusterLeaveEvent ( + val fabricIndex: Int) { + override fun toString(): String = buildString { append("BasicInformationClusterLeaveEvent {\n") append("\tfabricIndex : $fabricIndex\n") append("}\n") @@ -40,10 +45,10 @@ class BasicInformationClusterLeaveEvent(val fabricIndex: Int) { companion object { private const val TAG_FABRIC_INDEX = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterLeaveEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterLeaveEvent { tlvReader.enterStructure(tag) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return BasicInformationClusterLeaveEvent(fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt index c40211aa617dcc..025e619be435d4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BasicInformationClusterReachableChangedEvent(val reachableNewValue: Boolean) { - override fun toString(): String = buildString { +import java.util.Optional + +class BasicInformationClusterReachableChangedEvent ( + val reachableNewValue: Boolean) { + override fun toString(): String = buildString { append("BasicInformationClusterReachableChangedEvent {\n") append("\treachableNewValue : $reachableNewValue\n") append("}\n") @@ -40,10 +45,10 @@ class BasicInformationClusterReachableChangedEvent(val reachableNewValue: Boolea companion object { private const val TAG_REACHABLE_NEW_VALUE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterReachableChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterReachableChangedEvent { tlvReader.enterStructure(tag) val reachableNewValue = tlvReader.getBoolean(ContextSpecificTag(TAG_REACHABLE_NEW_VALUE)) - + tlvReader.exitContainer() return BasicInformationClusterReachableChangedEvent(reachableNewValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt index 23082666b05cae..f0ab0ec9b2e99f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BasicInformationClusterStartUpEvent(val softwareVersion: Long) { - override fun toString(): String = buildString { +import java.util.Optional + +class BasicInformationClusterStartUpEvent ( + val softwareVersion: Long) { + override fun toString(): String = buildString { append("BasicInformationClusterStartUpEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("}\n") @@ -40,10 +45,10 @@ class BasicInformationClusterStartUpEvent(val softwareVersion: Long) { companion object { private const val TAG_SOFTWARE_VERSION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterStartUpEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterStartUpEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) - + tlvReader.exitContainer() return BasicInformationClusterStartUpEvent(softwareVersion) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt index a0ecfb76141580..8194ba7d1f742d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BooleanStateClusterStateChangeEvent(val stateValue: Boolean) { - override fun toString(): String = buildString { +import java.util.Optional + +class BooleanStateClusterStateChangeEvent ( + val stateValue: Boolean) { + override fun toString(): String = buildString { append("BooleanStateClusterStateChangeEvent {\n") append("\tstateValue : $stateValue\n") append("}\n") @@ -40,10 +45,10 @@ class BooleanStateClusterStateChangeEvent(val stateValue: Boolean) { companion object { private const val TAG_STATE_VALUE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BooleanStateClusterStateChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BooleanStateClusterStateChangeEvent { tlvReader.enterStructure(tag) val stateValue = tlvReader.getBoolean(ContextSpecificTag(TAG_STATE_VALUE)) - + tlvReader.exitContainer() return BooleanStateClusterStateChangeEvent(stateValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt index e75b2f7af96f93..c66f3595c88152 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BridgedDeviceBasicInformationClusterReachableChangedEvent(val reachableNewValue: Boolean) { - override fun toString(): String = buildString { +import java.util.Optional + +class BridgedDeviceBasicInformationClusterReachableChangedEvent ( + val reachableNewValue: Boolean) { + override fun toString(): String = buildString { append("BridgedDeviceBasicInformationClusterReachableChangedEvent {\n") append("\treachableNewValue : $reachableNewValue\n") append("}\n") @@ -40,13 +45,10 @@ class BridgedDeviceBasicInformationClusterReachableChangedEvent(val reachableNew companion object { private const val TAG_REACHABLE_NEW_VALUE = 0 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): BridgedDeviceBasicInformationClusterReachableChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BridgedDeviceBasicInformationClusterReachableChangedEvent { tlvReader.enterStructure(tag) val reachableNewValue = tlvReader.getBoolean(ContextSpecificTag(TAG_REACHABLE_NEW_VALUE)) - + tlvReader.exitContainer() return BridgedDeviceBasicInformationClusterReachableChangedEvent(reachableNewValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt index 80c60be6847056..9b1e886926c1bd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BridgedDeviceBasicInformationClusterStartUpEvent(val softwareVersion: Long) { - override fun toString(): String = buildString { +import java.util.Optional + +class BridgedDeviceBasicInformationClusterStartUpEvent ( + val softwareVersion: Long) { + override fun toString(): String = buildString { append("BridgedDeviceBasicInformationClusterStartUpEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("}\n") @@ -40,10 +45,10 @@ class BridgedDeviceBasicInformationClusterStartUpEvent(val softwareVersion: Long companion object { private const val TAG_SOFTWARE_VERSION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BridgedDeviceBasicInformationClusterStartUpEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BridgedDeviceBasicInformationClusterStartUpEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) - + tlvReader.exitContainer() return BridgedDeviceBasicInformationClusterStartUpEvent(softwareVersion) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt index 0b7206788e842a..b2a29696b191a8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DishwasherAlarmClusterNotifyEvent( - val active: Long, - val inactive: Long, - val state: Long, - val mask: Long -) { - override fun toString(): String = buildString { +import java.util.Optional + +class DishwasherAlarmClusterNotifyEvent ( + val active: Long, + val inactive: Long, + val state: Long, + val mask: Long) { + override fun toString(): String = buildString { append("DishwasherAlarmClusterNotifyEvent {\n") append("\tactive : $active\n") append("\tinactive : $inactive\n") @@ -54,13 +57,13 @@ class DishwasherAlarmClusterNotifyEvent( private const val TAG_STATE = 2 private const val TAG_MASK = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DishwasherAlarmClusterNotifyEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DishwasherAlarmClusterNotifyEvent { tlvReader.enterStructure(tag) val active = tlvReader.getLong(ContextSpecificTag(TAG_ACTIVE)) val inactive = tlvReader.getLong(ContextSpecificTag(TAG_INACTIVE)) val state = tlvReader.getLong(ContextSpecificTag(TAG_STATE)) val mask = tlvReader.getLong(ContextSpecificTag(TAG_MASK)) - + tlvReader.exitContainer() return DishwasherAlarmClusterNotifyEvent(active, inactive, state, mask) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt index 6417fb85009e88..309eb4e52c29f2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DoorLockClusterDoorLockAlarmEvent(val alarmCode: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class DoorLockClusterDoorLockAlarmEvent ( + val alarmCode: Int) { + override fun toString(): String = buildString { append("DoorLockClusterDoorLockAlarmEvent {\n") append("\talarmCode : $alarmCode\n") append("}\n") @@ -40,10 +45,10 @@ class DoorLockClusterDoorLockAlarmEvent(val alarmCode: Int) { companion object { private const val TAG_ALARM_CODE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterDoorLockAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterDoorLockAlarmEvent { tlvReader.enterStructure(tag) val alarmCode = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_CODE)) - + tlvReader.exitContainer() return DoorLockClusterDoorLockAlarmEvent(alarmCode) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt index d0b6acbe7ea227..05068118f56c59 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DoorLockClusterDoorStateChangeEvent(val doorState: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class DoorLockClusterDoorStateChangeEvent ( + val doorState: Int) { + override fun toString(): String = buildString { append("DoorLockClusterDoorStateChangeEvent {\n") append("\tdoorState : $doorState\n") append("}\n") @@ -40,10 +45,10 @@ class DoorLockClusterDoorStateChangeEvent(val doorState: Int) { companion object { private const val TAG_DOOR_STATE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterDoorStateChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterDoorStateChangeEvent { tlvReader.enterStructure(tag) val doorState = tlvReader.getInt(ContextSpecificTag(TAG_DOOR_STATE)) - + tlvReader.exitContainer() return DoorLockClusterDoorStateChangeEvent(doorState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt index 59e38fa054dd87..34dd208597b65e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt @@ -20,21 +20,21 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class DoorLockClusterLockOperationErrorEvent( - val lockOperationType: Int, - val operationSource: Int, - val operationError: Int, - val userIndex: Int?, - val fabricIndex: Int?, - val sourceNode: Long?, - val credentials: - Optional>? -) { - override fun toString(): String = buildString { +class DoorLockClusterLockOperationErrorEvent ( + val lockOperationType: Int, + val operationSource: Int, + val operationError: Int, + val userIndex: Int?, + val fabricIndex: Int?, + val sourceNode: Long?, + val credentials: Optional>?) { + override fun toString(): String = buildString { append("DoorLockClusterLockOperationErrorEvent {\n") append("\tlockOperationType : $lockOperationType\n") append("\toperationSource : $operationSource\n") @@ -53,32 +53,32 @@ class DoorLockClusterLockOperationErrorEvent( put(ContextSpecificTag(TAG_OPERATION_SOURCE), operationSource) put(ContextSpecificTag(TAG_OPERATION_ERROR), operationError) if (userIndex != null) { - put(ContextSpecificTag(TAG_USER_INDEX), userIndex) - } else { - putNull(ContextSpecificTag(TAG_USER_INDEX)) - } + put(ContextSpecificTag(TAG_USER_INDEX), userIndex) + } else { + putNull(ContextSpecificTag(TAG_USER_INDEX)) + } if (fabricIndex != null) { - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) - } else { - putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - } + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + } else { + putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + } if (sourceNode != null) { - put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) - } else { - putNull(ContextSpecificTag(TAG_SOURCE_NODE)) - } + put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) + } else { + putNull(ContextSpecificTag(TAG_SOURCE_NODE)) + } if (credentials != null) { - if (credentials.isPresent) { - val optcredentials = credentials.get() - startList(ContextSpecificTag(TAG_CREDENTIALS)) - for (item in optcredentials.iterator()) { - item.toTlv(AnonymousTag, this) - } - endList() - } - } else { - putNull(ContextSpecificTag(TAG_CREDENTIALS)) + if (credentials.isPresent) { + val optcredentials = credentials.get() + startList(ContextSpecificTag(TAG_CREDENTIALS)) + for (item in optcredentials.iterator()) { + item.toTlv(AnonymousTag, this) } + endList() + } + } else { + putNull(ContextSpecificTag(TAG_CREDENTIALS)) + } endStructure() } } @@ -92,68 +92,49 @@ class DoorLockClusterLockOperationErrorEvent( private const val TAG_SOURCE_NODE = 5 private const val TAG_CREDENTIALS = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterLockOperationErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterLockOperationErrorEvent { tlvReader.enterStructure(tag) val lockOperationType = tlvReader.getInt(ContextSpecificTag(TAG_LOCK_OPERATION_TYPE)) val operationSource = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_SOURCE)) val operationError = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_ERROR)) - val userIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) - null - } - val fabricIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - null - } - val sourceNode = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) - null - } - val credentials = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { - Optional.of( - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) - while (!tlvReader.isEndOfContainer()) { - this.add( - chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv( - AnonymousTag, - tlvReader - ) - ) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) - null - } - + val userIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) + null + } + val fabricIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + null + } + val sourceNode = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) + null + } + val credentials = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { + Optional.of(buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) + while(!tlvReader.isEndOfContainer()) { + this.add(chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + }) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) + null + } + tlvReader.exitContainer() - return DoorLockClusterLockOperationErrorEvent( - lockOperationType, - operationSource, - operationError, - userIndex, - fabricIndex, - sourceNode, - credentials - ) + return DoorLockClusterLockOperationErrorEvent(lockOperationType, operationSource, operationError, userIndex, fabricIndex, sourceNode, credentials) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt index 4fbf71082c7adc..d1f83b46c08222 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt @@ -20,20 +20,20 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class DoorLockClusterLockOperationEvent( - val lockOperationType: Int, - val operationSource: Int, - val userIndex: Int?, - val fabricIndex: Int?, - val sourceNode: Long?, - val credentials: - Optional>? -) { - override fun toString(): String = buildString { +class DoorLockClusterLockOperationEvent ( + val lockOperationType: Int, + val operationSource: Int, + val userIndex: Int?, + val fabricIndex: Int?, + val sourceNode: Long?, + val credentials: Optional>?) { + override fun toString(): String = buildString { append("DoorLockClusterLockOperationEvent {\n") append("\tlockOperationType : $lockOperationType\n") append("\toperationSource : $operationSource\n") @@ -50,32 +50,32 @@ class DoorLockClusterLockOperationEvent( put(ContextSpecificTag(TAG_LOCK_OPERATION_TYPE), lockOperationType) put(ContextSpecificTag(TAG_OPERATION_SOURCE), operationSource) if (userIndex != null) { - put(ContextSpecificTag(TAG_USER_INDEX), userIndex) - } else { - putNull(ContextSpecificTag(TAG_USER_INDEX)) - } + put(ContextSpecificTag(TAG_USER_INDEX), userIndex) + } else { + putNull(ContextSpecificTag(TAG_USER_INDEX)) + } if (fabricIndex != null) { - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) - } else { - putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - } + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + } else { + putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + } if (sourceNode != null) { - put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) - } else { - putNull(ContextSpecificTag(TAG_SOURCE_NODE)) - } + put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) + } else { + putNull(ContextSpecificTag(TAG_SOURCE_NODE)) + } if (credentials != null) { - if (credentials.isPresent) { - val optcredentials = credentials.get() - startList(ContextSpecificTag(TAG_CREDENTIALS)) - for (item in optcredentials.iterator()) { - item.toTlv(AnonymousTag, this) - } - endList() - } - } else { - putNull(ContextSpecificTag(TAG_CREDENTIALS)) + if (credentials.isPresent) { + val optcredentials = credentials.get() + startList(ContextSpecificTag(TAG_CREDENTIALS)) + for (item in optcredentials.iterator()) { + item.toTlv(AnonymousTag, this) } + endList() + } + } else { + putNull(ContextSpecificTag(TAG_CREDENTIALS)) + } endStructure() } } @@ -88,66 +88,48 @@ class DoorLockClusterLockOperationEvent( private const val TAG_SOURCE_NODE = 4 private const val TAG_CREDENTIALS = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterLockOperationEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterLockOperationEvent { tlvReader.enterStructure(tag) val lockOperationType = tlvReader.getInt(ContextSpecificTag(TAG_LOCK_OPERATION_TYPE)) val operationSource = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_SOURCE)) - val userIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) - null - } - val fabricIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - null - } - val sourceNode = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) - null - } - val credentials = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { - Optional.of( - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) - while (!tlvReader.isEndOfContainer()) { - this.add( - chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv( - AnonymousTag, - tlvReader - ) - ) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) - null - } - + val userIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) + null + } + val fabricIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + null + } + val sourceNode = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) + null + } + val credentials = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { + Optional.of(buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) + while(!tlvReader.isEndOfContainer()) { + this.add(chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + }) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) + null + } + tlvReader.exitContainer() - return DoorLockClusterLockOperationEvent( - lockOperationType, - operationSource, - userIndex, - fabricIndex, - sourceNode, - credentials - ) + return DoorLockClusterLockOperationEvent(lockOperationType, operationSource, userIndex, fabricIndex, sourceNode, credentials) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt index 6fc562b39959ff..c8b7dd9380bb7f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt @@ -17,21 +17,24 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DoorLockClusterLockUserChangeEvent( - val lockDataType: Int, - val dataOperationType: Int, - val operationSource: Int, - val userIndex: Int?, - val fabricIndex: Int?, - val sourceNode: Long?, - val dataIndex: Int? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class DoorLockClusterLockUserChangeEvent ( + val lockDataType: Int, + val dataOperationType: Int, + val operationSource: Int, + val userIndex: Int?, + val fabricIndex: Int?, + val sourceNode: Long?, + val dataIndex: Int?) { + override fun toString(): String = buildString { append("DoorLockClusterLockUserChangeEvent {\n") append("\tlockDataType : $lockDataType\n") append("\tdataOperationType : $dataOperationType\n") @@ -50,25 +53,25 @@ class DoorLockClusterLockUserChangeEvent( put(ContextSpecificTag(TAG_DATA_OPERATION_TYPE), dataOperationType) put(ContextSpecificTag(TAG_OPERATION_SOURCE), operationSource) if (userIndex != null) { - put(ContextSpecificTag(TAG_USER_INDEX), userIndex) - } else { - putNull(ContextSpecificTag(TAG_USER_INDEX)) - } + put(ContextSpecificTag(TAG_USER_INDEX), userIndex) + } else { + putNull(ContextSpecificTag(TAG_USER_INDEX)) + } if (fabricIndex != null) { - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) - } else { - putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - } + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + } else { + putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + } if (sourceNode != null) { - put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) - } else { - putNull(ContextSpecificTag(TAG_SOURCE_NODE)) - } + put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) + } else { + putNull(ContextSpecificTag(TAG_SOURCE_NODE)) + } if (dataIndex != null) { - put(ContextSpecificTag(TAG_DATA_INDEX), dataIndex) - } else { - putNull(ContextSpecificTag(TAG_DATA_INDEX)) - } + put(ContextSpecificTag(TAG_DATA_INDEX), dataIndex) + } else { + putNull(ContextSpecificTag(TAG_DATA_INDEX)) + } endStructure() } } @@ -82,51 +85,39 @@ class DoorLockClusterLockUserChangeEvent( private const val TAG_SOURCE_NODE = 5 private const val TAG_DATA_INDEX = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterLockUserChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterLockUserChangeEvent { tlvReader.enterStructure(tag) val lockDataType = tlvReader.getInt(ContextSpecificTag(TAG_LOCK_DATA_TYPE)) val dataOperationType = tlvReader.getInt(ContextSpecificTag(TAG_DATA_OPERATION_TYPE)) val operationSource = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_SOURCE)) - val userIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) - null - } - val fabricIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - null - } - val sourceNode = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) - null - } - val dataIndex = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_DATA_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_DATA_INDEX)) - null - } - + val userIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) + null + } + val fabricIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + null + } + val sourceNode = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) + null + } + val dataIndex = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_DATA_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_DATA_INDEX)) + null + } + tlvReader.exitContainer() - return DoorLockClusterLockUserChangeEvent( - lockDataType, - dataOperationType, - operationSource, - userIndex, - fabricIndex, - sourceNode, - dataIndex - ) + return DoorLockClusterLockUserChangeEvent(lockDataType, dataOperationType, operationSource, userIndex, fabricIndex, sourceNode, dataIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt index 3d743983f1a00f..79b58b0d67cdae 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GeneralDiagnosticsClusterBootReasonEvent(val bootReason: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class GeneralDiagnosticsClusterBootReasonEvent ( + val bootReason: Int) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterBootReasonEvent {\n") append("\tbootReason : $bootReason\n") append("}\n") @@ -40,10 +45,10 @@ class GeneralDiagnosticsClusterBootReasonEvent(val bootReason: Int) { companion object { private const val TAG_BOOT_REASON = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterBootReasonEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterBootReasonEvent { tlvReader.enterStructure(tag) val bootReason = tlvReader.getInt(ContextSpecificTag(TAG_BOOT_REASON)) - + tlvReader.exitContainer() return GeneralDiagnosticsClusterBootReasonEvent(bootReason) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt index 1287eba322b742..207d45c24e3c40 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt @@ -20,14 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GeneralDiagnosticsClusterHardwareFaultChangeEvent( - val current: List, - val previous: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GeneralDiagnosticsClusterHardwareFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterHardwareFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -55,25 +57,23 @@ class GeneralDiagnosticsClusterHardwareFaultChangeEvent( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterHardwareFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterHardwareFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return GeneralDiagnosticsClusterHardwareFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt index f9fc3cadc8b934..5fed1abd0f4c09 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt @@ -20,14 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GeneralDiagnosticsClusterNetworkFaultChangeEvent( - val current: List, - val previous: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GeneralDiagnosticsClusterNetworkFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterNetworkFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -55,25 +57,23 @@ class GeneralDiagnosticsClusterNetworkFaultChangeEvent( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterNetworkFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterNetworkFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return GeneralDiagnosticsClusterNetworkFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt index 35daf8dd691bf5..7a0b4e386ca3f9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt @@ -20,14 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GeneralDiagnosticsClusterRadioFaultChangeEvent( - val current: List, - val previous: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GeneralDiagnosticsClusterRadioFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterRadioFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -55,25 +57,23 @@ class GeneralDiagnosticsClusterRadioFaultChangeEvent( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterRadioFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterRadioFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return GeneralDiagnosticsClusterRadioFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt index 092e062784a118..8e0999dbb5eed6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class OperationalStateClusterOperationCompletionEvent( - val completionErrorCode: Int, - val totalOperationalTime: Optional?, - val pausedTime: Optional? -) { - override fun toString(): String = buildString { +class OperationalStateClusterOperationCompletionEvent ( + val completionErrorCode: Int, + val totalOperationalTime: Optional?, + val pausedTime: Optional?) { + override fun toString(): String = buildString { append("OperationalStateClusterOperationCompletionEvent {\n") append("\tcompletionErrorCode : $completionErrorCode\n") append("\ttotalOperationalTime : $totalOperationalTime\n") @@ -41,21 +43,21 @@ class OperationalStateClusterOperationCompletionEvent( startStructure(tag) put(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE), completionErrorCode) if (totalOperationalTime != null) { - if (totalOperationalTime.isPresent) { - val opttotalOperationalTime = totalOperationalTime.get() - put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) - } - } else { - putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - } + if (totalOperationalTime.isPresent) { + val opttotalOperationalTime = totalOperationalTime.get() + put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) + } + } else { + putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + } if (pausedTime != null) { - if (pausedTime.isPresent) { - val optpausedTime = pausedTime.get() - put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) - } - } else { - putNull(ContextSpecificTag(TAG_PAUSED_TIME)) - } + if (pausedTime.isPresent) { + val optpausedTime = pausedTime.get() + put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) + } + } else { + putNull(ContextSpecificTag(TAG_PAUSED_TIME)) + } endStructure() } } @@ -65,39 +67,33 @@ class OperationalStateClusterOperationCompletionEvent( private const val TAG_TOTAL_OPERATIONAL_TIME = 1 private const val TAG_PAUSED_TIME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterOperationCompletionEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterOperationCompletionEvent { tlvReader.enterStructure(tag) val completionErrorCode = tlvReader.getInt(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE)) - val totalOperationalTime = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - null - } - val pausedTime = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) - null - } - + val totalOperationalTime = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + null + } + val pausedTime = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) + null + } + tlvReader.exitContainer() - return OperationalStateClusterOperationCompletionEvent( - completionErrorCode, - totalOperationalTime, - pausedTime - ) + return OperationalStateClusterOperationCompletionEvent(completionErrorCode, totalOperationalTime, pausedTime) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt index b5623a0d701579..ef4633c2ffe087 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt @@ -17,15 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OperationalStateClusterOperationalErrorEvent( - val errorState: chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OperationalStateClusterOperationalErrorEvent ( + val errorState: chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct) { + override fun toString(): String = buildString { append("OperationalStateClusterOperationalErrorEvent {\n") append("\terrorState : $errorState\n") append("}\n") @@ -42,14 +45,10 @@ class OperationalStateClusterOperationalErrorEvent( companion object { private const val TAG_ERROR_STATE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterOperationalErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterOperationalErrorEvent { tlvReader.enterStructure(tag) - val errorState = - chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct.fromTlv( - ContextSpecificTag(TAG_ERROR_STATE), - tlvReader - ) - + val errorState = chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct.fromTlv(ContextSpecificTag(TAG_ERROR_STATE), tlvReader) + tlvReader.exitContainer() return OperationalStateClusterOperationalErrorEvent(errorState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt index 8a82cbf93c9f1f..3e7ac690e0fbab 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent( - val softwareVersion: Long, - val bytesDownloaded: Long, - val progressPercent: Int?, - val platformCode: Long? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent ( + val softwareVersion: Long, + val bytesDownloaded: Long, + val progressPercent: Int?, + val platformCode: Long?) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterDownloadErrorEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("\tbytesDownloaded : $bytesDownloaded\n") @@ -43,15 +46,15 @@ class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent( put(ContextSpecificTag(TAG_SOFTWARE_VERSION), softwareVersion) put(ContextSpecificTag(TAG_BYTES_DOWNLOADED), bytesDownloaded) if (progressPercent != null) { - put(ContextSpecificTag(TAG_PROGRESS_PERCENT), progressPercent) - } else { - putNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) - } + put(ContextSpecificTag(TAG_PROGRESS_PERCENT), progressPercent) + } else { + putNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) + } if (platformCode != null) { - put(ContextSpecificTag(TAG_PLATFORM_CODE), platformCode) - } else { - putNull(ContextSpecificTag(TAG_PLATFORM_CODE)) - } + put(ContextSpecificTag(TAG_PLATFORM_CODE), platformCode) + } else { + putNull(ContextSpecificTag(TAG_PLATFORM_CODE)) + } endStructure() } } @@ -62,36 +65,26 @@ class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent( private const val TAG_PROGRESS_PERCENT = 2 private const val TAG_PLATFORM_CODE = 3 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): OtaSoftwareUpdateRequestorClusterDownloadErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterDownloadErrorEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) val bytesDownloaded = tlvReader.getLong(ContextSpecificTag(TAG_BYTES_DOWNLOADED)) - val progressPercent = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_PROGRESS_PERCENT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) - null - } - val platformCode = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_PLATFORM_CODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PLATFORM_CODE)) - null - } - + val progressPercent = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_PROGRESS_PERCENT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) + null + } + val platformCode = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_PLATFORM_CODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PLATFORM_CODE)) + null + } + tlvReader.exitContainer() - return OtaSoftwareUpdateRequestorClusterDownloadErrorEvent( - softwareVersion, - bytesDownloaded, - progressPercent, - platformCode - ) + return OtaSoftwareUpdateRequestorClusterDownloadErrorEvent(softwareVersion, bytesDownloaded, progressPercent, platformCode) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt index b0b075689fc3be..bcd1db0f6990bf 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OtaSoftwareUpdateRequestorClusterStateTransitionEvent( - val previousState: Int, - val newState: Int, - val reason: Int, - val targetSoftwareVersion: Long? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OtaSoftwareUpdateRequestorClusterStateTransitionEvent ( + val previousState: Int, + val newState: Int, + val reason: Int, + val targetSoftwareVersion: Long?) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterStateTransitionEvent {\n") append("\tpreviousState : $previousState\n") append("\tnewState : $newState\n") @@ -44,10 +47,10 @@ class OtaSoftwareUpdateRequestorClusterStateTransitionEvent( put(ContextSpecificTag(TAG_NEW_STATE), newState) put(ContextSpecificTag(TAG_REASON), reason) if (targetSoftwareVersion != null) { - put(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION), targetSoftwareVersion) - } else { - putNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) - } + put(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION), targetSoftwareVersion) + } else { + putNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) + } endStructure() } } @@ -58,30 +61,21 @@ class OtaSoftwareUpdateRequestorClusterStateTransitionEvent( private const val TAG_REASON = 2 private const val TAG_TARGET_SOFTWARE_VERSION = 3 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): OtaSoftwareUpdateRequestorClusterStateTransitionEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterStateTransitionEvent { tlvReader.enterStructure(tag) val previousState = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_STATE)) val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE)) val reason = tlvReader.getInt(ContextSpecificTag(TAG_REASON)) - val targetSoftwareVersion = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) - null - } - + val targetSoftwareVersion = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) + null + } + tlvReader.exitContainer() - return OtaSoftwareUpdateRequestorClusterStateTransitionEvent( - previousState, - newState, - reason, - targetSoftwareVersion - ) + return OtaSoftwareUpdateRequestorClusterStateTransitionEvent(previousState, newState, reason, targetSoftwareVersion) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt index ff1034ace97e31..96bb018c4e0bd0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OtaSoftwareUpdateRequestorClusterVersionAppliedEvent( - val softwareVersion: Long, - val productID: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OtaSoftwareUpdateRequestorClusterVersionAppliedEvent ( + val softwareVersion: Long, + val productID: Int) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterVersionAppliedEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("\tproductID : $productID\n") @@ -46,14 +49,11 @@ class OtaSoftwareUpdateRequestorClusterVersionAppliedEvent( private const val TAG_SOFTWARE_VERSION = 0 private const val TAG_PRODUCT_I_D = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): OtaSoftwareUpdateRequestorClusterVersionAppliedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterVersionAppliedEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) val productID = tlvReader.getInt(ContextSpecificTag(TAG_PRODUCT_I_D)) - + tlvReader.exitContainer() return OtaSoftwareUpdateRequestorClusterVersionAppliedEvent(softwareVersion, productID) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt index c3eb0d1e658b56..eb8be2f538a999 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt @@ -20,11 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class PowerSourceClusterBatChargeFaultChangeEvent(val current: List, val previous: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class PowerSourceClusterBatChargeFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatChargeFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -52,25 +57,23 @@ class PowerSourceClusterBatChargeFaultChangeEvent(val current: List, val pr private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatChargeFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatChargeFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatChargeFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt index c010184156ecb3..782fba2707b2f5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt @@ -20,11 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class PowerSourceClusterBatFaultChangeEvent(val current: List, val previous: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class PowerSourceClusterBatFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -52,25 +57,23 @@ class PowerSourceClusterBatFaultChangeEvent(val current: List, val previous private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt index 8a06b36fba61d0..1906ef9014899d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt @@ -20,11 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class PowerSourceClusterWiredFaultChangeEvent(val current: List, val previous: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class PowerSourceClusterWiredFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterWiredFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -52,25 +57,23 @@ class PowerSourceClusterWiredFaultChangeEvent(val current: List, val previo private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterWiredFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterWiredFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterWiredFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt index c116f16ac73229..a67296515fc256 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class RefrigeratorAlarmClusterNotifyEvent( - val active: Long, - val inactive: Long, - val state: Long, - val mask: Long -) { - override fun toString(): String = buildString { +import java.util.Optional + +class RefrigeratorAlarmClusterNotifyEvent ( + val active: Long, + val inactive: Long, + val state: Long, + val mask: Long) { + override fun toString(): String = buildString { append("RefrigeratorAlarmClusterNotifyEvent {\n") append("\tactive : $active\n") append("\tinactive : $inactive\n") @@ -54,13 +57,13 @@ class RefrigeratorAlarmClusterNotifyEvent( private const val TAG_STATE = 2 private const val TAG_MASK = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RefrigeratorAlarmClusterNotifyEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RefrigeratorAlarmClusterNotifyEvent { tlvReader.enterStructure(tag) val active = tlvReader.getLong(ContextSpecificTag(TAG_ACTIVE)) val inactive = tlvReader.getLong(ContextSpecificTag(TAG_INACTIVE)) val state = tlvReader.getLong(ContextSpecificTag(TAG_STATE)) val mask = tlvReader.getLong(ContextSpecificTag(TAG_MASK)) - + tlvReader.exitContainer() return RefrigeratorAlarmClusterNotifyEvent(active, inactive, state, mask) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt index c6afaa9750adf8..f43dd669cf87ca 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class RvcOperationalStateClusterOperationCompletionEvent( - val completionErrorCode: Int, - val totalOperationalTime: Optional?, - val pausedTime: Optional? -) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterOperationCompletionEvent ( + val completionErrorCode: Int, + val totalOperationalTime: Optional?, + val pausedTime: Optional?) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterOperationCompletionEvent {\n") append("\tcompletionErrorCode : $completionErrorCode\n") append("\ttotalOperationalTime : $totalOperationalTime\n") @@ -41,21 +43,21 @@ class RvcOperationalStateClusterOperationCompletionEvent( startStructure(tag) put(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE), completionErrorCode) if (totalOperationalTime != null) { - if (totalOperationalTime.isPresent) { - val opttotalOperationalTime = totalOperationalTime.get() - put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) - } - } else { - putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - } + if (totalOperationalTime.isPresent) { + val opttotalOperationalTime = totalOperationalTime.get() + put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) + } + } else { + putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + } if (pausedTime != null) { - if (pausedTime.isPresent) { - val optpausedTime = pausedTime.get() - put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) - } - } else { - putNull(ContextSpecificTag(TAG_PAUSED_TIME)) - } + if (pausedTime.isPresent) { + val optpausedTime = pausedTime.get() + put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) + } + } else { + putNull(ContextSpecificTag(TAG_PAUSED_TIME)) + } endStructure() } } @@ -65,42 +67,33 @@ class RvcOperationalStateClusterOperationCompletionEvent( private const val TAG_TOTAL_OPERATIONAL_TIME = 1 private const val TAG_PAUSED_TIME = 2 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): RvcOperationalStateClusterOperationCompletionEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterOperationCompletionEvent { tlvReader.enterStructure(tag) val completionErrorCode = tlvReader.getInt(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE)) - val totalOperationalTime = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - null - } - val pausedTime = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) - null - } - + val totalOperationalTime = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + null + } + val pausedTime = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) + null + } + tlvReader.exitContainer() - return RvcOperationalStateClusterOperationCompletionEvent( - completionErrorCode, - totalOperationalTime, - pausedTime - ) + return RvcOperationalStateClusterOperationCompletionEvent(completionErrorCode, totalOperationalTime, pausedTime) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt index bf6fed9817f60f..ee80a6e06fb3a6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt @@ -17,15 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class RvcOperationalStateClusterOperationalErrorEvent( - val errorState: chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct -) { - override fun toString(): String = buildString { +import java.util.Optional + +class RvcOperationalStateClusterOperationalErrorEvent ( + val errorState: chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterOperationalErrorEvent {\n") append("\terrorState : $errorState\n") append("}\n") @@ -42,14 +45,10 @@ class RvcOperationalStateClusterOperationalErrorEvent( companion object { private const val TAG_ERROR_STATE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcOperationalStateClusterOperationalErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterOperationalErrorEvent { tlvReader.enterStructure(tag) - val errorState = - chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct.fromTlv( - ContextSpecificTag(TAG_ERROR_STATE), - tlvReader - ) - + val errorState = chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct.fromTlv(ContextSpecificTag(TAG_ERROR_STATE), tlvReader) + tlvReader.exitContainer() return RvcOperationalStateClusterOperationalErrorEvent(errorState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt index 2bc948e2a667b1..0c2e543c57451c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SmokeCoAlarmClusterCOAlarmEvent(val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SmokeCoAlarmClusterCOAlarmEvent ( + val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterCOAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -40,10 +45,10 @@ class SmokeCoAlarmClusterCOAlarmEvent(val alarmSeverityLevel: Int) { companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterCOAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterCOAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterCOAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt index 19223606c4685d..6ddfb212cc0515 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SmokeCoAlarmClusterInterconnectCOAlarmEvent(val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SmokeCoAlarmClusterInterconnectCOAlarmEvent ( + val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterInterconnectCOAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -40,10 +45,10 @@ class SmokeCoAlarmClusterInterconnectCOAlarmEvent(val alarmSeverityLevel: Int) { companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterInterconnectCOAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterInterconnectCOAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterInterconnectCOAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt index 38e2fe872915f7..c3ada5b8d56ba2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent(val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent ( + val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterInterconnectSmokeAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -40,10 +45,10 @@ class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent(val alarmSeverityLevel: Int companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterInterconnectSmokeAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterInterconnectSmokeAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterInterconnectSmokeAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt index ce2d9ad47341d0..a1b2573db15fb6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SmokeCoAlarmClusterLowBatteryEvent(val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SmokeCoAlarmClusterLowBatteryEvent ( + val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterLowBatteryEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -40,10 +45,10 @@ class SmokeCoAlarmClusterLowBatteryEvent(val alarmSeverityLevel: Int) { companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterLowBatteryEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterLowBatteryEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterLowBatteryEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt index 324a5d4461a225..01753b1e77aa97 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SmokeCoAlarmClusterSmokeAlarmEvent(val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SmokeCoAlarmClusterSmokeAlarmEvent ( + val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterSmokeAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -40,10 +45,10 @@ class SmokeCoAlarmClusterSmokeAlarmEvent(val alarmSeverityLevel: Int) { companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterSmokeAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterSmokeAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterSmokeAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt index 50b455842e538f..1ae05ccf0043b2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class SoftwareDiagnosticsClusterSoftwareFaultEvent( - val id: Long, - val name: Optional, - val faultRecording: Optional -) { - override fun toString(): String = buildString { +class SoftwareDiagnosticsClusterSoftwareFaultEvent ( + val id: Long, + val name: Optional, + val faultRecording: Optional) { + override fun toString(): String = buildString { append("SoftwareDiagnosticsClusterSoftwareFaultEvent {\n") append("\tid : $id\n") append("\tname : $name\n") @@ -41,13 +43,13 @@ class SoftwareDiagnosticsClusterSoftwareFaultEvent( startStructure(tag) put(ContextSpecificTag(TAG_ID), id) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } if (faultRecording.isPresent) { - val optfaultRecording = faultRecording.get() - put(ContextSpecificTag(TAG_FAULT_RECORDING), optfaultRecording) - } + val optfaultRecording = faultRecording.get() + put(ContextSpecificTag(TAG_FAULT_RECORDING), optfaultRecording) + } endStructure() } } @@ -57,22 +59,20 @@ class SoftwareDiagnosticsClusterSoftwareFaultEvent( private const val TAG_NAME = 1 private const val TAG_FAULT_RECORDING = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SoftwareDiagnosticsClusterSoftwareFaultEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SoftwareDiagnosticsClusterSoftwareFaultEvent { tlvReader.enterStructure(tag) val id = tlvReader.getLong(ContextSpecificTag(TAG_ID)) - val name = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - val faultRecording = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_FAULT_RECORDING))) { - Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_FAULT_RECORDING))) - } else { - Optional.empty() - } - + val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val faultRecording = if (tlvReader.isNextTag(ContextSpecificTag(TAG_FAULT_RECORDING))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_FAULT_RECORDING))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return SoftwareDiagnosticsClusterSoftwareFaultEvent(id, name, faultRecording) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt index 893412c1f25322..62973598b9aff5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterInitialPressEvent(val newPosition: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterInitialPressEvent ( + val newPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterInitialPressEvent {\n") append("\tnewPosition : $newPosition\n") append("}\n") @@ -40,10 +45,10 @@ class SwitchClusterInitialPressEvent(val newPosition: Int) { companion object { private const val TAG_NEW_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterInitialPressEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterInitialPressEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - + tlvReader.exitContainer() return SwitchClusterInitialPressEvent(newPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt index 3fa420f46ddec3..d67e1ba0076ca9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterLongPressEvent(val newPosition: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterLongPressEvent ( + val newPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterLongPressEvent {\n") append("\tnewPosition : $newPosition\n") append("}\n") @@ -40,10 +45,10 @@ class SwitchClusterLongPressEvent(val newPosition: Int) { companion object { private const val TAG_NEW_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterLongPressEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterLongPressEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - + tlvReader.exitContainer() return SwitchClusterLongPressEvent(newPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt index eb90698fc735ab..c26312888c3d2d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterLongReleaseEvent(val previousPosition: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterLongReleaseEvent ( + val previousPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterLongReleaseEvent {\n") append("\tpreviousPosition : $previousPosition\n") append("}\n") @@ -40,10 +45,10 @@ class SwitchClusterLongReleaseEvent(val previousPosition: Int) { companion object { private const val TAG_PREVIOUS_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterLongReleaseEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterLongReleaseEvent { tlvReader.enterStructure(tag) val previousPosition = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_POSITION)) - + tlvReader.exitContainer() return SwitchClusterLongReleaseEvent(previousPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt index 81141e17424fbb..1e7eb6055668a6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterMultiPressCompleteEvent( - val previousPosition: Int, - val totalNumberOfPressesCounted: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterMultiPressCompleteEvent ( + val previousPosition: Int, + val totalNumberOfPressesCounted: Int) { + override fun toString(): String = buildString { append("SwitchClusterMultiPressCompleteEvent {\n") append("\tpreviousPosition : $previousPosition\n") append("\ttotalNumberOfPressesCounted : $totalNumberOfPressesCounted\n") @@ -46,12 +49,11 @@ class SwitchClusterMultiPressCompleteEvent( private const val TAG_PREVIOUS_POSITION = 0 private const val TAG_TOTAL_NUMBER_OF_PRESSES_COUNTED = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterMultiPressCompleteEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterMultiPressCompleteEvent { tlvReader.enterStructure(tag) val previousPosition = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_POSITION)) - val totalNumberOfPressesCounted = - tlvReader.getInt(ContextSpecificTag(TAG_TOTAL_NUMBER_OF_PRESSES_COUNTED)) - + val totalNumberOfPressesCounted = tlvReader.getInt(ContextSpecificTag(TAG_TOTAL_NUMBER_OF_PRESSES_COUNTED)) + tlvReader.exitContainer() return SwitchClusterMultiPressCompleteEvent(previousPosition, totalNumberOfPressesCounted) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt index 11fab26fdfce8e..0500e314f696ef 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterMultiPressOngoingEvent( - val newPosition: Int, - val currentNumberOfPressesCounted: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterMultiPressOngoingEvent ( + val newPosition: Int, + val currentNumberOfPressesCounted: Int) { + override fun toString(): String = buildString { append("SwitchClusterMultiPressOngoingEvent {\n") append("\tnewPosition : $newPosition\n") append("\tcurrentNumberOfPressesCounted : $currentNumberOfPressesCounted\n") @@ -46,12 +49,11 @@ class SwitchClusterMultiPressOngoingEvent( private const val TAG_NEW_POSITION = 0 private const val TAG_CURRENT_NUMBER_OF_PRESSES_COUNTED = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterMultiPressOngoingEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterMultiPressOngoingEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - val currentNumberOfPressesCounted = - tlvReader.getInt(ContextSpecificTag(TAG_CURRENT_NUMBER_OF_PRESSES_COUNTED)) - + val currentNumberOfPressesCounted = tlvReader.getInt(ContextSpecificTag(TAG_CURRENT_NUMBER_OF_PRESSES_COUNTED)) + tlvReader.exitContainer() return SwitchClusterMultiPressOngoingEvent(newPosition, currentNumberOfPressesCounted) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt index 0eeb9e2841fd7c..5d3e2f26c7fd0c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterShortReleaseEvent(val previousPosition: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterShortReleaseEvent ( + val previousPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterShortReleaseEvent {\n") append("\tpreviousPosition : $previousPosition\n") append("}\n") @@ -40,10 +45,10 @@ class SwitchClusterShortReleaseEvent(val previousPosition: Int) { companion object { private const val TAG_PREVIOUS_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterShortReleaseEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterShortReleaseEvent { tlvReader.enterStructure(tag) val previousPosition = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_POSITION)) - + tlvReader.exitContainer() return SwitchClusterShortReleaseEvent(previousPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt index 2b921b37ac6c2b..ec54e50aae31af 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class SwitchClusterSwitchLatchedEvent(val newPosition: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class SwitchClusterSwitchLatchedEvent ( + val newPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterSwitchLatchedEvent {\n") append("\tnewPosition : $newPosition\n") append("}\n") @@ -40,10 +45,10 @@ class SwitchClusterSwitchLatchedEvent(val newPosition: Int) { companion object { private const val TAG_NEW_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterSwitchLatchedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterSwitchLatchedEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - + tlvReader.exitContainer() return SwitchClusterSwitchLatchedEvent(newPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt index ffdc72b1e54c89..cca6b8f8499a17 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThreadNetworkDiagnosticsClusterConnectionStatusEvent(val connectionStatus: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThreadNetworkDiagnosticsClusterConnectionStatusEvent ( + val connectionStatus: Int) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterConnectionStatusEvent {\n") append("\tconnectionStatus : $connectionStatus\n") append("}\n") @@ -40,13 +45,10 @@ class ThreadNetworkDiagnosticsClusterConnectionStatusEvent(val connectionStatus: companion object { private const val TAG_CONNECTION_STATUS = 0 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): ThreadNetworkDiagnosticsClusterConnectionStatusEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterConnectionStatusEvent { tlvReader.enterStructure(tag) val connectionStatus = tlvReader.getInt(ContextSpecificTag(TAG_CONNECTION_STATUS)) - + tlvReader.exitContainer() return ThreadNetworkDiagnosticsClusterConnectionStatusEvent(connectionStatus) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt index f9110c39fa1d40..ef103a4821a3e2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt @@ -20,14 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent( - val current: List, - val previous: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -55,28 +57,23 @@ class ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt index 53090f750b4e06..b66f227f0d07fe 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class TimeSynchronizationClusterDSTStatusEvent(val DSTOffsetActive: Boolean) { - override fun toString(): String = buildString { +import java.util.Optional + +class TimeSynchronizationClusterDSTStatusEvent ( + val DSTOffsetActive: Boolean) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterDSTStatusEvent {\n") append("\tDSTOffsetActive : $DSTOffsetActive\n") append("}\n") @@ -40,10 +45,10 @@ class TimeSynchronizationClusterDSTStatusEvent(val DSTOffsetActive: Boolean) { companion object { private const val TAG_D_S_T_OFFSET_ACTIVE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterDSTStatusEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterDSTStatusEvent { tlvReader.enterStructure(tag) val DSTOffsetActive = tlvReader.getBoolean(ContextSpecificTag(TAG_D_S_T_OFFSET_ACTIVE)) - + tlvReader.exitContainer() return TimeSynchronizationClusterDSTStatusEvent(DSTOffsetActive) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt index 452e9d902c4767..2ccb1685646258 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt @@ -17,14 +17,19 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class TimeSynchronizationClusterTimeZoneStatusEvent(val offset: Long, val name: Optional) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterTimeZoneStatusEvent ( + val offset: Long, + val name: Optional) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterTimeZoneStatusEvent {\n") append("\toffset : $offset\n") append("\tname : $name\n") @@ -36,9 +41,9 @@ class TimeSynchronizationClusterTimeZoneStatusEvent(val offset: Long, val name: startStructure(tag) put(ContextSpecificTag(TAG_OFFSET), offset) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } endStructure() } } @@ -47,16 +52,15 @@ class TimeSynchronizationClusterTimeZoneStatusEvent(val offset: Long, val name: private const val TAG_OFFSET = 0 private const val TAG_NAME = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterTimeZoneStatusEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterTimeZoneStatusEvent { tlvReader.enterStructure(tag) val offset = tlvReader.getLong(ContextSpecificTag(TAG_OFFSET)) - val name = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - + val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return TimeSynchronizationClusterTimeZoneStatusEvent(offset, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt index 8c2e410ab80f6d..1787e26580dba6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt @@ -20,18 +20,20 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterTestEventEvent( - val arg1: Int, - val arg2: Int, - val arg3: Boolean, - val arg4: chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct, - val arg5: List, - val arg6: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterTestEventEvent ( + val arg1: Int, + val arg2: Int, + val arg3: Boolean, + val arg4: chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct, + val arg5: List, + val arg6: List) { + override fun toString(): String = buildString { append("UnitTestingClusterTestEventEvent {\n") append("\targ1 : $arg1\n") append("\targ2 : $arg2\n") @@ -71,38 +73,27 @@ class UnitTestingClusterTestEventEvent( private const val TAG_ARG5 = 5 private const val TAG_ARG6 = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestEventEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestEventEvent { tlvReader.enterStructure(tag) val arg1 = tlvReader.getInt(ContextSpecificTag(TAG_ARG1)) val arg2 = tlvReader.getInt(ContextSpecificTag(TAG_ARG2)) val arg3 = tlvReader.getBoolean(ContextSpecificTag(TAG_ARG3)) - val arg4 = - chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv( - ContextSpecificTag(TAG_ARG4), - tlvReader - ) - val arg5 = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ARG5)) - while (!tlvReader.isEndOfContainer()) { - this.add( - chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv( - AnonymousTag, - tlvReader - ) - ) - } - tlvReader.exitContainer() - } - val arg6 = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ARG6)) - while (!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val arg4 = chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_ARG4), tlvReader) + val arg5 = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ARG5)) + while(!tlvReader.isEndOfContainer()) { + this.add(chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val arg6 = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ARG6)) + while(!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return UnitTestingClusterTestEventEvent(arg1, arg2, arg3, arg4, arg5, arg6) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt index d746c65d5ea1f1..1995cf80a3b1fc 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterTestFabricScopedEventEvent(val fabricIndex: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterTestFabricScopedEventEvent ( + val fabricIndex: Int) { + override fun toString(): String = buildString { append("UnitTestingClusterTestFabricScopedEventEvent {\n") append("\tfabricIndex : $fabricIndex\n") append("}\n") @@ -40,10 +45,10 @@ class UnitTestingClusterTestFabricScopedEventEvent(val fabricIndex: Int) { companion object { private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestFabricScopedEventEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestFabricScopedEventEvent { tlvReader.enterStructure(tag) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return UnitTestingClusterTestFabricScopedEventEvent(fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt index 087484ef1bfa7b..5db782d0005a54 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class WiFiNetworkDiagnosticsClusterAssociationFailureEvent( - val associationFailure: Int, - val status: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class WiFiNetworkDiagnosticsClusterAssociationFailureEvent ( + val associationFailure: Int, + val status: Int) { + override fun toString(): String = buildString { append("WiFiNetworkDiagnosticsClusterAssociationFailureEvent {\n") append("\tassociationFailure : $associationFailure\n") append("\tstatus : $status\n") @@ -46,14 +49,11 @@ class WiFiNetworkDiagnosticsClusterAssociationFailureEvent( private const val TAG_ASSOCIATION_FAILURE = 0 private const val TAG_STATUS = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): WiFiNetworkDiagnosticsClusterAssociationFailureEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : WiFiNetworkDiagnosticsClusterAssociationFailureEvent { tlvReader.enterStructure(tag) val associationFailure = tlvReader.getInt(ContextSpecificTag(TAG_ASSOCIATION_FAILURE)) val status = tlvReader.getInt(ContextSpecificTag(TAG_STATUS)) - + tlvReader.exitContainer() return WiFiNetworkDiagnosticsClusterAssociationFailureEvent(associationFailure, status) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt index 3599597c99b152..762339bde4f556 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class WiFiNetworkDiagnosticsClusterConnectionStatusEvent(val connectionStatus: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class WiFiNetworkDiagnosticsClusterConnectionStatusEvent ( + val connectionStatus: Int) { + override fun toString(): String = buildString { append("WiFiNetworkDiagnosticsClusterConnectionStatusEvent {\n") append("\tconnectionStatus : $connectionStatus\n") append("}\n") @@ -40,13 +45,10 @@ class WiFiNetworkDiagnosticsClusterConnectionStatusEvent(val connectionStatus: I companion object { private const val TAG_CONNECTION_STATUS = 0 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): WiFiNetworkDiagnosticsClusterConnectionStatusEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : WiFiNetworkDiagnosticsClusterConnectionStatusEvent { tlvReader.enterStructure(tag) val connectionStatus = tlvReader.getInt(ContextSpecificTag(TAG_CONNECTION_STATUS)) - + tlvReader.exitContainer() return WiFiNetworkDiagnosticsClusterConnectionStatusEvent(connectionStatus) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt index 6d54ae4f2bfdcd..2a702882f2557a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt @@ -17,13 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class WiFiNetworkDiagnosticsClusterDisconnectionEvent(val reasonCode: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class WiFiNetworkDiagnosticsClusterDisconnectionEvent ( + val reasonCode: Int) { + override fun toString(): String = buildString { append("WiFiNetworkDiagnosticsClusterDisconnectionEvent {\n") append("\treasonCode : $reasonCode\n") append("}\n") @@ -40,10 +45,10 @@ class WiFiNetworkDiagnosticsClusterDisconnectionEvent(val reasonCode: Int) { companion object { private const val TAG_REASON_CODE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): WiFiNetworkDiagnosticsClusterDisconnectionEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : WiFiNetworkDiagnosticsClusterDisconnectionEvent { tlvReader.enterStructure(tag) val reasonCode = tlvReader.getInt(ContextSpecificTag(TAG_REASON_CODE)) - + tlvReader.exitContainer() return WiFiNetworkDiagnosticsClusterDisconnectionEvent(reasonCode) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt index 6daac4451c1833..a526275e085718 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt @@ -20,17 +20,19 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class AccessControlClusterAccessControlEntryStruct( - val privilege: Int, - val authMode: Int, - val subjects: List?, - val targets: List?, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class AccessControlClusterAccessControlEntryStruct ( + val privilege: Int, + val authMode: Int, + val subjects: List?, + val targets: List?, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlEntryStruct {\n") append("\tprivilege : $privilege\n") append("\tauthMode : $authMode\n") @@ -46,23 +48,23 @@ class AccessControlClusterAccessControlEntryStruct( put(ContextSpecificTag(TAG_PRIVILEGE), privilege) put(ContextSpecificTag(TAG_AUTH_MODE), authMode) if (subjects != null) { - startList(ContextSpecificTag(TAG_SUBJECTS)) - for (item in subjects.iterator()) { - put(AnonymousTag, item) - } - endList() - } else { - putNull(ContextSpecificTag(TAG_SUBJECTS)) + startList(ContextSpecificTag(TAG_SUBJECTS)) + for (item in subjects.iterator()) { + put(AnonymousTag, item) } + endList() + } else { + putNull(ContextSpecificTag(TAG_SUBJECTS)) + } if (targets != null) { - startList(ContextSpecificTag(TAG_TARGETS)) - for (item in targets.iterator()) { - item.toTlv(AnonymousTag, this) - } - endList() - } else { - putNull(ContextSpecificTag(TAG_TARGETS)) + startList(ContextSpecificTag(TAG_TARGETS)) + for (item in targets.iterator()) { + item.toTlv(AnonymousTag, this) } + endList() + } else { + putNull(ContextSpecificTag(TAG_TARGETS)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -75,47 +77,39 @@ class AccessControlClusterAccessControlEntryStruct( private const val TAG_TARGETS = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): AccessControlClusterAccessControlEntryStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlEntryStruct { tlvReader.enterStructure(tag) val privilege = tlvReader.getInt(ContextSpecificTag(TAG_PRIVILEGE)) val authMode = tlvReader.getInt(ContextSpecificTag(TAG_AUTH_MODE)) - val subjects = - if (!tlvReader.isNull()) { - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_SUBJECTS)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getLong(AnonymousTag)) - } - tlvReader.exitContainer() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SUBJECTS)) - null - } - val targets = - if (!tlvReader.isNull()) { - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_TARGETS)) - while (!tlvReader.isEndOfContainer()) { - add(AccessControlClusterAccessControlTargetStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TARGETS)) - null - } + val subjects = if (!tlvReader.isNull()) { + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_SUBJECTS)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getLong(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SUBJECTS)) + null + } + val targets = if (!tlvReader.isNull()) { + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_TARGETS)) + while(!tlvReader.isEndOfContainer()) { + add(AccessControlClusterAccessControlTargetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TARGETS)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return AccessControlClusterAccessControlEntryStruct( - privilege, - authMode, - subjects, - targets, - fabricIndex - ) + return AccessControlClusterAccessControlEntryStruct(privilege, authMode, subjects, targets, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt index 4a1d95221d816c..9b832daa283b9f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class AccessControlClusterAccessControlExtensionStruct(val data: ByteArray, val fabricIndex: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class AccessControlClusterAccessControlExtensionStruct ( + val data: ByteArray, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlExtensionStruct {\n") append("\tdata : $data\n") append("\tfabricIndex : $fabricIndex\n") @@ -43,11 +49,11 @@ class AccessControlClusterAccessControlExtensionStruct(val data: ByteArray, val private const val TAG_DATA = 1 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): AccessControlClusterAccessControlExtensionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlExtensionStruct { tlvReader.enterStructure(tag) val data = tlvReader.getByteArray(ContextSpecificTag(TAG_DATA)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return AccessControlClusterAccessControlExtensionStruct(data, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt index e721aa3fefe91d..8070aecfe241b5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class AccessControlClusterAccessControlTargetStruct( - val cluster: Long?, - val endpoint: Int?, - val deviceType: Long? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class AccessControlClusterAccessControlTargetStruct ( + val cluster: Long?, + val endpoint: Int?, + val deviceType: Long?) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlTargetStruct {\n") append("\tcluster : $cluster\n") append("\tendpoint : $endpoint\n") @@ -39,20 +42,20 @@ class AccessControlClusterAccessControlTargetStruct( tlvWriter.apply { startStructure(tag) if (cluster != null) { - put(ContextSpecificTag(TAG_CLUSTER), cluster) - } else { - putNull(ContextSpecificTag(TAG_CLUSTER)) - } + put(ContextSpecificTag(TAG_CLUSTER), cluster) + } else { + putNull(ContextSpecificTag(TAG_CLUSTER)) + } if (endpoint != null) { - put(ContextSpecificTag(TAG_ENDPOINT), endpoint) - } else { - putNull(ContextSpecificTag(TAG_ENDPOINT)) - } + put(ContextSpecificTag(TAG_ENDPOINT), endpoint) + } else { + putNull(ContextSpecificTag(TAG_ENDPOINT)) + } if (deviceType != null) { - put(ContextSpecificTag(TAG_DEVICE_TYPE), deviceType) - } else { - putNull(ContextSpecificTag(TAG_DEVICE_TYPE)) - } + put(ContextSpecificTag(TAG_DEVICE_TYPE), deviceType) + } else { + putNull(ContextSpecificTag(TAG_DEVICE_TYPE)) + } endStructure() } } @@ -62,30 +65,27 @@ class AccessControlClusterAccessControlTargetStruct( private const val TAG_ENDPOINT = 1 private const val TAG_DEVICE_TYPE = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): AccessControlClusterAccessControlTargetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlTargetStruct { tlvReader.enterStructure(tag) - val cluster = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_CLUSTER)) - null - } - val endpoint = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ENDPOINT)) - null - } - val deviceType = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_DEVICE_TYPE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_DEVICE_TYPE)) - null - } - + val cluster = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CLUSTER)) + null + } + val endpoint = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ENDPOINT)) + null + } + val deviceType = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_DEVICE_TYPE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_DEVICE_TYPE)) + null + } + tlvReader.exitContainer() return AccessControlClusterAccessControlTargetStruct(cluster, endpoint, deviceType) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt index 2ed7a3f08152be..9dc8c67a270df1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt @@ -17,20 +17,23 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ActionsClusterActionStruct( - val actionID: Int, - val name: String, - val type: Int, - val endpointListID: Int, - val supportedCommands: Int, - val state: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ActionsClusterActionStruct ( + val actionID: Int, + val name: String, + val type: Int, + val endpointListID: Int, + val supportedCommands: Int, + val state: Int) { + override fun toString(): String = buildString { append("ActionsClusterActionStruct {\n") append("\tactionID : $actionID\n") append("\tname : $name\n") @@ -62,7 +65,7 @@ class ActionsClusterActionStruct( private const val TAG_SUPPORTED_COMMANDS = 4 private const val TAG_STATE = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterActionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterActionStruct { tlvReader.enterStructure(tag) val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) @@ -70,17 +73,10 @@ class ActionsClusterActionStruct( val endpointListID = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT_LIST_I_D)) val supportedCommands = tlvReader.getInt(ContextSpecificTag(TAG_SUPPORTED_COMMANDS)) val state = tlvReader.getInt(ContextSpecificTag(TAG_STATE)) - + tlvReader.exitContainer() - return ActionsClusterActionStruct( - actionID, - name, - type, - endpointListID, - supportedCommands, - state - ) + return ActionsClusterActionStruct(actionID, name, type, endpointListID, supportedCommands, state) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt index b714e693156957..5d46b079c5e9bf 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt @@ -20,16 +20,18 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ActionsClusterEndpointListStruct( - val endpointListID: Int, - val name: String, - val type: Int, - val endpoints: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ActionsClusterEndpointListStruct ( + val endpointListID: Int, + val name: String, + val type: Int, + val endpoints: List) { + override fun toString(): String = buildString { append("ActionsClusterEndpointListStruct {\n") append("\tendpointListID : $endpointListID\n") append("\tname : $name\n") @@ -59,20 +61,19 @@ class ActionsClusterEndpointListStruct( private const val TAG_TYPE = 2 private const val TAG_ENDPOINTS = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterEndpointListStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterEndpointListStruct { tlvReader.enterStructure(tag) val endpointListID = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT_LIST_I_D)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val type = tlvReader.getInt(ContextSpecificTag(TAG_TYPE)) - val endpoints = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val endpoints = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ActionsClusterEndpointListStruct(endpointListID, name, type, endpoints) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt index 68a44d37dfff0f..f4f298dadf0fcc 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ActivatedCarbonFilterMonitoringClusterReplacementProductStruct( - val productIdentifierType: Int, - val productIdentifierValue: String -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ActivatedCarbonFilterMonitoringClusterReplacementProductStruct ( + val productIdentifierType: Int, + val productIdentifierValue: String) { + override fun toString(): String = buildString { append("ActivatedCarbonFilterMonitoringClusterReplacementProductStruct {\n") append("\tproductIdentifierType : $productIdentifierType\n") append("\tproductIdentifierValue : $productIdentifierValue\n") @@ -46,21 +49,14 @@ class ActivatedCarbonFilterMonitoringClusterReplacementProductStruct( private const val TAG_PRODUCT_IDENTIFIER_TYPE = 0 private const val TAG_PRODUCT_IDENTIFIER_VALUE = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): ActivatedCarbonFilterMonitoringClusterReplacementProductStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActivatedCarbonFilterMonitoringClusterReplacementProductStruct { tlvReader.enterStructure(tag) val productIdentifierType = tlvReader.getInt(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_TYPE)) - val productIdentifierValue = - tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) - + val productIdentifierValue = tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) + tlvReader.exitContainer() - return ActivatedCarbonFilterMonitoringClusterReplacementProductStruct( - productIdentifierType, - productIdentifierValue - ) + return ActivatedCarbonFilterMonitoringClusterReplacementProductStruct(productIdentifierType, productIdentifierValue) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt index 21649a8ecc73df..aa1effe8df43cd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ApplicationBasicClusterApplicationStruct( - val catalogVendorID: Int, - val applicationID: String -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ApplicationBasicClusterApplicationStruct ( + val catalogVendorID: Int, + val applicationID: String) { + override fun toString(): String = buildString { append("ApplicationBasicClusterApplicationStruct {\n") append("\tcatalogVendorID : $catalogVendorID\n") append("\tapplicationID : $applicationID\n") @@ -46,11 +49,11 @@ class ApplicationBasicClusterApplicationStruct( private const val TAG_CATALOG_VENDOR_I_D = 0 private const val TAG_APPLICATION_I_D = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ApplicationBasicClusterApplicationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ApplicationBasicClusterApplicationStruct { tlvReader.enterStructure(tag) val catalogVendorID = tlvReader.getInt(ContextSpecificTag(TAG_CATALOG_VENDOR_I_D)) val applicationID = tlvReader.getString(ContextSpecificTag(TAG_APPLICATION_I_D)) - + tlvReader.exitContainer() return ApplicationBasicClusterApplicationStruct(catalogVendorID, applicationID) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt index f710204737cb52..cf701fb6c1a094 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt @@ -17,17 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class ApplicationLauncherClusterApplicationEPStruct( - val application: ApplicationLauncherClusterApplicationStruct, - val endpoint: Optional -) { - override fun toString(): String = buildString { +class ApplicationLauncherClusterApplicationEPStruct ( + val application: ApplicationLauncherClusterApplicationStruct, + val endpoint: Optional) { + override fun toString(): String = buildString { append("ApplicationLauncherClusterApplicationEPStruct {\n") append("\tapplication : $application\n") append("\tendpoint : $endpoint\n") @@ -39,9 +41,9 @@ class ApplicationLauncherClusterApplicationEPStruct( startStructure(tag) application.toTlv(ContextSpecificTag(TAG_APPLICATION), this) if (endpoint.isPresent) { - val optendpoint = endpoint.get() - put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) - } + val optendpoint = endpoint.get() + put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) + } endStructure() } } @@ -50,20 +52,15 @@ class ApplicationLauncherClusterApplicationEPStruct( private const val TAG_APPLICATION = 0 private const val TAG_ENDPOINT = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ApplicationLauncherClusterApplicationEPStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ApplicationLauncherClusterApplicationEPStruct { tlvReader.enterStructure(tag) - val application = - ApplicationLauncherClusterApplicationStruct.fromTlv( - ContextSpecificTag(TAG_APPLICATION), - tlvReader - ) - val endpoint = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) - } else { - Optional.empty() - } - + val application = ApplicationLauncherClusterApplicationStruct.fromTlv(ContextSpecificTag(TAG_APPLICATION), tlvReader) + val endpoint = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return ApplicationLauncherClusterApplicationEPStruct(application, endpoint) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt index 68e78e31084c04..b9b7f772372d19 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ApplicationLauncherClusterApplicationStruct( - val catalogVendorID: Int, - val applicationID: String -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ApplicationLauncherClusterApplicationStruct ( + val catalogVendorID: Int, + val applicationID: String) { + override fun toString(): String = buildString { append("ApplicationLauncherClusterApplicationStruct {\n") append("\tcatalogVendorID : $catalogVendorID\n") append("\tapplicationID : $applicationID\n") @@ -46,11 +49,11 @@ class ApplicationLauncherClusterApplicationStruct( private const val TAG_CATALOG_VENDOR_I_D = 0 private const val TAG_APPLICATION_I_D = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ApplicationLauncherClusterApplicationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ApplicationLauncherClusterApplicationStruct { tlvReader.enterStructure(tag) val catalogVendorID = tlvReader.getInt(ContextSpecificTag(TAG_CATALOG_VENDOR_I_D)) val applicationID = tlvReader.getString(ContextSpecificTag(TAG_APPLICATION_I_D)) - + tlvReader.exitContainer() return ApplicationLauncherClusterApplicationStruct(catalogVendorID, applicationID) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt index aef8596f19a83c..028781fa7acfb5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt @@ -17,13 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class AudioOutputClusterOutputInfoStruct(val index: Int, val outputType: Int, val name: String) { - override fun toString(): String = buildString { +import java.util.Optional + +class AudioOutputClusterOutputInfoStruct ( + val index: Int, + val outputType: Int, + val name: String) { + override fun toString(): String = buildString { append("AudioOutputClusterOutputInfoStruct {\n") append("\tindex : $index\n") append("\toutputType : $outputType\n") @@ -46,12 +53,12 @@ class AudioOutputClusterOutputInfoStruct(val index: Int, val outputType: Int, va private const val TAG_OUTPUT_TYPE = 1 private const val TAG_NAME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): AudioOutputClusterOutputInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : AudioOutputClusterOutputInfoStruct { tlvReader.enterStructure(tag) val index = tlvReader.getInt(ContextSpecificTag(TAG_INDEX)) val outputType = tlvReader.getInt(ContextSpecificTag(TAG_OUTPUT_TYPE)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) - + tlvReader.exitContainer() return AudioOutputClusterOutputInfoStruct(index, outputType, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt index e4f323b6321541..8a58e9a242ed40 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BasicInformationClusterCapabilityMinimaStruct( - val caseSessionsPerFabric: Int, - val subscriptionsPerFabric: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class BasicInformationClusterCapabilityMinimaStruct ( + val caseSessionsPerFabric: Int, + val subscriptionsPerFabric: Int) { + override fun toString(): String = buildString { append("BasicInformationClusterCapabilityMinimaStruct {\n") append("\tcaseSessionsPerFabric : $caseSessionsPerFabric\n") append("\tsubscriptionsPerFabric : $subscriptionsPerFabric\n") @@ -46,18 +49,14 @@ class BasicInformationClusterCapabilityMinimaStruct( private const val TAG_CASE_SESSIONS_PER_FABRIC = 0 private const val TAG_SUBSCRIPTIONS_PER_FABRIC = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterCapabilityMinimaStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterCapabilityMinimaStruct { tlvReader.enterStructure(tag) val caseSessionsPerFabric = tlvReader.getInt(ContextSpecificTag(TAG_CASE_SESSIONS_PER_FABRIC)) - val subscriptionsPerFabric = - tlvReader.getInt(ContextSpecificTag(TAG_SUBSCRIPTIONS_PER_FABRIC)) - + val subscriptionsPerFabric = tlvReader.getInt(ContextSpecificTag(TAG_SUBSCRIPTIONS_PER_FABRIC)) + tlvReader.exitContainer() - return BasicInformationClusterCapabilityMinimaStruct( - caseSessionsPerFabric, - subscriptionsPerFabric - ) + return BasicInformationClusterCapabilityMinimaStruct(caseSessionsPerFabric, subscriptionsPerFabric) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt index 3678494c7b90fb..e01685c44e3566 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BasicInformationClusterProductAppearanceStruct(val finish: Int, val primaryColor: Int?) { - override fun toString(): String = buildString { +import java.util.Optional + +class BasicInformationClusterProductAppearanceStruct ( + val finish: Int, + val primaryColor: Int?) { + override fun toString(): String = buildString { append("BasicInformationClusterProductAppearanceStruct {\n") append("\tfinish : $finish\n") append("\tprimaryColor : $primaryColor\n") @@ -35,10 +41,10 @@ class BasicInformationClusterProductAppearanceStruct(val finish: Int, val primar startStructure(tag) put(ContextSpecificTag(TAG_FINISH), finish) if (primaryColor != null) { - put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) - } else { - putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } + put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) + } else { + putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } endStructure() } } @@ -47,17 +53,16 @@ class BasicInformationClusterProductAppearanceStruct(val finish: Int, val primar private const val TAG_FINISH = 0 private const val TAG_PRIMARY_COLOR = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterProductAppearanceStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterProductAppearanceStruct { tlvReader.enterStructure(tag) val finish = tlvReader.getInt(ContextSpecificTag(TAG_FINISH)) - val primaryColor = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - null - } - + val primaryColor = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + null + } + tlvReader.exitContainer() return BasicInformationClusterProductAppearanceStruct(finish, primaryColor) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt index 8ab0146b8e95f3..861ebbd1875f58 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt @@ -17,20 +17,22 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class BindingClusterTargetStruct( - val node: Optional, - val group: Optional, - val endpoint: Optional, - val cluster: Optional, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +class BindingClusterTargetStruct ( + val node: Optional, + val group: Optional, + val endpoint: Optional, + val cluster: Optional, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("BindingClusterTargetStruct {\n") append("\tnode : $node\n") append("\tgroup : $group\n") @@ -44,21 +46,21 @@ class BindingClusterTargetStruct( tlvWriter.apply { startStructure(tag) if (node.isPresent) { - val optnode = node.get() - put(ContextSpecificTag(TAG_NODE), optnode) - } + val optnode = node.get() + put(ContextSpecificTag(TAG_NODE), optnode) + } if (group.isPresent) { - val optgroup = group.get() - put(ContextSpecificTag(TAG_GROUP), optgroup) - } + val optgroup = group.get() + put(ContextSpecificTag(TAG_GROUP), optgroup) + } if (endpoint.isPresent) { - val optendpoint = endpoint.get() - put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) - } + val optendpoint = endpoint.get() + put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) + } if (cluster.isPresent) { - val optcluster = cluster.get() - put(ContextSpecificTag(TAG_CLUSTER), optcluster) - } + val optcluster = cluster.get() + put(ContextSpecificTag(TAG_CLUSTER), optcluster) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -71,34 +73,30 @@ class BindingClusterTargetStruct( private const val TAG_CLUSTER = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): BindingClusterTargetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BindingClusterTargetStruct { tlvReader.enterStructure(tag) - val node = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NODE))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_NODE))) - } else { - Optional.empty() - } - val group = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_GROUP))) - } else { - Optional.empty() - } - val endpoint = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) - } else { - Optional.empty() - } - val cluster = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CLUSTER))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER))) - } else { - Optional.empty() - } + val node = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NODE))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_NODE))) + } else { + Optional.empty() + } + val group = if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_GROUP))) + } else { + Optional.empty() + } + val endpoint = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) + } else { + Optional.empty() + } + val cluster = if (tlvReader.isNextTag(ContextSpecificTag(TAG_CLUSTER))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER))) + } else { + Optional.empty() + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return BindingClusterTargetStruct(node, group, endpoint, cluster, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt index d1426bc0828631..778935a86e9455 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class BridgedDeviceBasicInformationClusterProductAppearanceStruct( - val finish: Int, - val primaryColor: Int? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class BridgedDeviceBasicInformationClusterProductAppearanceStruct ( + val finish: Int, + val primaryColor: Int?) { + override fun toString(): String = buildString { append("BridgedDeviceBasicInformationClusterProductAppearanceStruct {\n") append("\tfinish : $finish\n") append("\tprimaryColor : $primaryColor\n") @@ -38,10 +41,10 @@ class BridgedDeviceBasicInformationClusterProductAppearanceStruct( startStructure(tag) put(ContextSpecificTag(TAG_FINISH), finish) if (primaryColor != null) { - put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) - } else { - putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } + put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) + } else { + putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } endStructure() } } @@ -50,20 +53,16 @@ class BridgedDeviceBasicInformationClusterProductAppearanceStruct( private const val TAG_FINISH = 0 private const val TAG_PRIMARY_COLOR = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): BridgedDeviceBasicInformationClusterProductAppearanceStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : BridgedDeviceBasicInformationClusterProductAppearanceStruct { tlvReader.enterStructure(tag) val finish = tlvReader.getInt(ContextSpecificTag(TAG_FINISH)) - val primaryColor = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - null - } - + val primaryColor = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + null + } + tlvReader.exitContainer() return BridgedDeviceBasicInformationClusterProductAppearanceStruct(finish, primaryColor) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt index 9d10bf6f24e5fa..acfddff56c75cb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt @@ -17,20 +17,22 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class ChannelClusterChannelInfoStruct( - val majorNumber: Int, - val minorNumber: Int, - val name: Optional, - val callSign: Optional, - val affiliateCallSign: Optional -) { - override fun toString(): String = buildString { +class ChannelClusterChannelInfoStruct ( + val majorNumber: Int, + val minorNumber: Int, + val name: Optional, + val callSign: Optional, + val affiliateCallSign: Optional) { + override fun toString(): String = buildString { append("ChannelClusterChannelInfoStruct {\n") append("\tmajorNumber : $majorNumber\n") append("\tminorNumber : $minorNumber\n") @@ -46,17 +48,17 @@ class ChannelClusterChannelInfoStruct( put(ContextSpecificTag(TAG_MAJOR_NUMBER), majorNumber) put(ContextSpecificTag(TAG_MINOR_NUMBER), minorNumber) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } if (callSign.isPresent) { - val optcallSign = callSign.get() - put(ContextSpecificTag(TAG_CALL_SIGN), optcallSign) - } + val optcallSign = callSign.get() + put(ContextSpecificTag(TAG_CALL_SIGN), optcallSign) + } if (affiliateCallSign.isPresent) { - val optaffiliateCallSign = affiliateCallSign.get() - put(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN), optaffiliateCallSign) - } + val optaffiliateCallSign = affiliateCallSign.get() + put(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN), optaffiliateCallSign) + } endStructure() } } @@ -68,38 +70,29 @@ class ChannelClusterChannelInfoStruct( private const val TAG_CALL_SIGN = 3 private const val TAG_AFFILIATE_CALL_SIGN = 4 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ChannelClusterChannelInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ChannelClusterChannelInfoStruct { tlvReader.enterStructure(tag) val majorNumber = tlvReader.getInt(ContextSpecificTag(TAG_MAJOR_NUMBER)) val minorNumber = tlvReader.getInt(ContextSpecificTag(TAG_MINOR_NUMBER)) - val name = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - val callSign = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CALL_SIGN))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CALL_SIGN))) - } else { - Optional.empty() - } - val affiliateCallSign = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) - } else { - Optional.empty() - } - + val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val callSign = if (tlvReader.isNextTag(ContextSpecificTag(TAG_CALL_SIGN))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CALL_SIGN))) + } else { + Optional.empty() + } + val affiliateCallSign = if (tlvReader.isNextTag(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return ChannelClusterChannelInfoStruct( - majorNumber, - minorNumber, - name, - callSign, - affiliateCallSign - ) + return ChannelClusterChannelInfoStruct(majorNumber, minorNumber, name, callSign, affiliateCallSign) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt index edc8f9157db120..0010ae68479954 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt @@ -17,19 +17,21 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class ChannelClusterLineupInfoStruct( - val operatorName: String, - val lineupName: Optional, - val postalCode: Optional, - val lineupInfoType: Int -) { - override fun toString(): String = buildString { +class ChannelClusterLineupInfoStruct ( + val operatorName: String, + val lineupName: Optional, + val postalCode: Optional, + val lineupInfoType: Int) { + override fun toString(): String = buildString { append("ChannelClusterLineupInfoStruct {\n") append("\toperatorName : $operatorName\n") append("\tlineupName : $lineupName\n") @@ -43,13 +45,13 @@ class ChannelClusterLineupInfoStruct( startStructure(tag) put(ContextSpecificTag(TAG_OPERATOR_NAME), operatorName) if (lineupName.isPresent) { - val optlineupName = lineupName.get() - put(ContextSpecificTag(TAG_LINEUP_NAME), optlineupName) - } + val optlineupName = lineupName.get() + put(ContextSpecificTag(TAG_LINEUP_NAME), optlineupName) + } if (postalCode.isPresent) { - val optpostalCode = postalCode.get() - put(ContextSpecificTag(TAG_POSTAL_CODE), optpostalCode) - } + val optpostalCode = postalCode.get() + put(ContextSpecificTag(TAG_POSTAL_CODE), optpostalCode) + } put(ContextSpecificTag(TAG_LINEUP_INFO_TYPE), lineupInfoType) endStructure() } @@ -61,23 +63,21 @@ class ChannelClusterLineupInfoStruct( private const val TAG_POSTAL_CODE = 2 private const val TAG_LINEUP_INFO_TYPE = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ChannelClusterLineupInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ChannelClusterLineupInfoStruct { tlvReader.enterStructure(tag) val operatorName = tlvReader.getString(ContextSpecificTag(TAG_OPERATOR_NAME)) - val lineupName = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_LINEUP_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LINEUP_NAME))) - } else { - Optional.empty() - } - val postalCode = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_POSTAL_CODE))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_POSTAL_CODE))) - } else { - Optional.empty() - } + val lineupName = if (tlvReader.isNextTag(ContextSpecificTag(TAG_LINEUP_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LINEUP_NAME))) + } else { + Optional.empty() + } + val postalCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_POSTAL_CODE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_POSTAL_CODE))) + } else { + Optional.empty() + } val lineupInfoType = tlvReader.getInt(ContextSpecificTag(TAG_LINEUP_INFO_TYPE)) - + tlvReader.exitContainer() return ChannelClusterLineupInfoStruct(operatorName, lineupName, postalCode, lineupInfoType) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt index 0e1ebee9f97df2..0e54edff044225 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ContentLauncherClusterAdditionalInfoStruct(val name: String, val value: String) { - override fun toString(): String = buildString { +import java.util.Optional + +class ContentLauncherClusterAdditionalInfoStruct ( + val name: String, + val value: String) { + override fun toString(): String = buildString { append("ContentLauncherClusterAdditionalInfoStruct {\n") append("\tname : $name\n") append("\tvalue : $value\n") @@ -43,11 +49,11 @@ class ContentLauncherClusterAdditionalInfoStruct(val name: String, val value: St private const val TAG_NAME = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterAdditionalInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterAdditionalInfoStruct { tlvReader.enterStructure(tag) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return ContentLauncherClusterAdditionalInfoStruct(name, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt index 5f4719e9c00ef8..993719fc427de5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt @@ -17,21 +17,23 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class ContentLauncherClusterBrandingInformationStruct( - val providerName: String, - val background: Optional, - val logo: Optional, - val progressBar: Optional, - val splash: Optional, - val waterMark: Optional -) { - override fun toString(): String = buildString { +class ContentLauncherClusterBrandingInformationStruct ( + val providerName: String, + val background: Optional, + val logo: Optional, + val progressBar: Optional, + val splash: Optional, + val waterMark: Optional) { + override fun toString(): String = buildString { append("ContentLauncherClusterBrandingInformationStruct {\n") append("\tproviderName : $providerName\n") append("\tbackground : $background\n") @@ -47,25 +49,25 @@ class ContentLauncherClusterBrandingInformationStruct( startStructure(tag) put(ContextSpecificTag(TAG_PROVIDER_NAME), providerName) if (background.isPresent) { - val optbackground = background.get() - optbackground.toTlv(ContextSpecificTag(TAG_BACKGROUND), this) - } + val optbackground = background.get() + optbackground.toTlv(ContextSpecificTag(TAG_BACKGROUND), this) + } if (logo.isPresent) { - val optlogo = logo.get() - optlogo.toTlv(ContextSpecificTag(TAG_LOGO), this) - } + val optlogo = logo.get() + optlogo.toTlv(ContextSpecificTag(TAG_LOGO), this) + } if (progressBar.isPresent) { - val optprogressBar = progressBar.get() - optprogressBar.toTlv(ContextSpecificTag(TAG_PROGRESS_BAR), this) - } + val optprogressBar = progressBar.get() + optprogressBar.toTlv(ContextSpecificTag(TAG_PROGRESS_BAR), this) + } if (splash.isPresent) { - val optsplash = splash.get() - optsplash.toTlv(ContextSpecificTag(TAG_SPLASH), this) - } + val optsplash = splash.get() + optsplash.toTlv(ContextSpecificTag(TAG_SPLASH), this) + } if (waterMark.isPresent) { - val optwaterMark = waterMark.get() - optwaterMark.toTlv(ContextSpecificTag(TAG_WATER_MARK), this) - } + val optwaterMark = waterMark.get() + optwaterMark.toTlv(ContextSpecificTag(TAG_WATER_MARK), this) + } endStructure() } } @@ -78,75 +80,38 @@ class ContentLauncherClusterBrandingInformationStruct( private const val TAG_SPLASH = 4 private const val TAG_WATER_MARK = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterBrandingInformationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterBrandingInformationStruct { tlvReader.enterStructure(tag) val providerName = tlvReader.getString(ContextSpecificTag(TAG_PROVIDER_NAME)) - val background = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_BACKGROUND))) { - Optional.of( - ContentLauncherClusterStyleInformationStruct.fromTlv( - ContextSpecificTag(TAG_BACKGROUND), - tlvReader - ) - ) - } else { - Optional.empty() - } - val logo = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_LOGO))) { - Optional.of( - ContentLauncherClusterStyleInformationStruct.fromTlv( - ContextSpecificTag(TAG_LOGO), - tlvReader - ) - ) - } else { - Optional.empty() - } - val progressBar = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_PROGRESS_BAR))) { - Optional.of( - ContentLauncherClusterStyleInformationStruct.fromTlv( - ContextSpecificTag(TAG_PROGRESS_BAR), - tlvReader - ) - ) - } else { - Optional.empty() - } - val splash = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_SPLASH))) { - Optional.of( - ContentLauncherClusterStyleInformationStruct.fromTlv( - ContextSpecificTag(TAG_SPLASH), - tlvReader - ) - ) - } else { - Optional.empty() - } - val waterMark = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_WATER_MARK))) { - Optional.of( - ContentLauncherClusterStyleInformationStruct.fromTlv( - ContextSpecificTag(TAG_WATER_MARK), - tlvReader - ) - ) - } else { - Optional.empty() - } - + val background = if (tlvReader.isNextTag(ContextSpecificTag(TAG_BACKGROUND))) { + Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_BACKGROUND), tlvReader)) + } else { + Optional.empty() + } + val logo = if (tlvReader.isNextTag(ContextSpecificTag(TAG_LOGO))) { + Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_LOGO), tlvReader)) + } else { + Optional.empty() + } + val progressBar = if (tlvReader.isNextTag(ContextSpecificTag(TAG_PROGRESS_BAR))) { + Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_PROGRESS_BAR), tlvReader)) + } else { + Optional.empty() + } + val splash = if (tlvReader.isNextTag(ContextSpecificTag(TAG_SPLASH))) { + Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_SPLASH), tlvReader)) + } else { + Optional.empty() + } + val waterMark = if (tlvReader.isNextTag(ContextSpecificTag(TAG_WATER_MARK))) { + Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_WATER_MARK), tlvReader)) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return ContentLauncherClusterBrandingInformationStruct( - providerName, - background, - logo, - progressBar, - splash, - waterMark - ) + return ContentLauncherClusterBrandingInformationStruct(providerName, background, logo, progressBar, splash, waterMark) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt index 9457b03907a4fb..b3b713ba8e8079 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt @@ -20,13 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ContentLauncherClusterContentSearchStruct( - val parameterList: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ContentLauncherClusterContentSearchStruct ( + val parameterList: List) { + override fun toString(): String = buildString { append("ContentLauncherClusterContentSearchStruct {\n") append("\tparameterList : $parameterList\n") append("}\n") @@ -47,17 +49,16 @@ class ContentLauncherClusterContentSearchStruct( companion object { private const val TAG_PARAMETER_LIST = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterContentSearchStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterContentSearchStruct { tlvReader.enterStructure(tag) - val parameterList = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PARAMETER_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(ContentLauncherClusterParameterStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val parameterList = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PARAMETER_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(ContentLauncherClusterParameterStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ContentLauncherClusterContentSearchStruct(parameterList) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt index a38245918bb476..2bf3ed85bae436 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ContentLauncherClusterDimensionStruct( - val width: Double, - val height: Double, - val metric: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ContentLauncherClusterDimensionStruct ( + val width: Double, + val height: Double, + val metric: Int) { + override fun toString(): String = buildString { append("ContentLauncherClusterDimensionStruct {\n") append("\twidth : $width\n") append("\theight : $height\n") @@ -50,12 +53,12 @@ class ContentLauncherClusterDimensionStruct( private const val TAG_HEIGHT = 1 private const val TAG_METRIC = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterDimensionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterDimensionStruct { tlvReader.enterStructure(tag) val width = tlvReader.getDouble(ContextSpecificTag(TAG_WIDTH)) val height = tlvReader.getDouble(ContextSpecificTag(TAG_HEIGHT)) val metric = tlvReader.getInt(ContextSpecificTag(TAG_METRIC)) - + tlvReader.exitContainer() return ContentLauncherClusterDimensionStruct(width, height, metric) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt index caf0f99848c93c..19f4e650b0615b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt @@ -20,16 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class ContentLauncherClusterParameterStruct( - val type: Int, - val value: String, - val externalIDList: Optional> -) { - override fun toString(): String = buildString { +class ContentLauncherClusterParameterStruct ( + val type: Int, + val value: String, + val externalIDList: Optional>) { + override fun toString(): String = buildString { append("ContentLauncherClusterParameterStruct {\n") append("\ttype : $type\n") append("\tvalue : $value\n") @@ -43,13 +44,13 @@ class ContentLauncherClusterParameterStruct( put(ContextSpecificTag(TAG_TYPE), type) put(ContextSpecificTag(TAG_VALUE), value) if (externalIDList.isPresent) { - val optexternalIDList = externalIDList.get() - startList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) - for (item in optexternalIDList.iterator()) { - item.toTlv(AnonymousTag, this) - } - endList() + val optexternalIDList = externalIDList.get() + startList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + for (item in optexternalIDList.iterator()) { + item.toTlv(AnonymousTag, this) } + endList() + } endStructure() } } @@ -59,25 +60,22 @@ class ContentLauncherClusterParameterStruct( private const val TAG_VALUE = 1 private const val TAG_EXTERNAL_I_D_LIST = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterParameterStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterParameterStruct { tlvReader.enterStructure(tag) val type = tlvReader.getInt(ContextSpecificTag(TAG_TYPE)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - val externalIDList = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST))) { - Optional.of( - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(ContentLauncherClusterAdditionalInfoStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() - } - + val externalIDList = if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST))) { + Optional.of(buildList { + tlvReader.enterList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(ContentLauncherClusterAdditionalInfoStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + }) + } else { + Optional.empty() + } + tlvReader.exitContainer() return ContentLauncherClusterParameterStruct(type, value, externalIDList) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt index d5e686bbb5ac45..b9f2044614dd71 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class ContentLauncherClusterStyleInformationStruct( - val imageURL: Optional, - val color: Optional, - val size: Optional -) { - override fun toString(): String = buildString { +class ContentLauncherClusterStyleInformationStruct ( + val imageURL: Optional, + val color: Optional, + val size: Optional) { + override fun toString(): String = buildString { append("ContentLauncherClusterStyleInformationStruct {\n") append("\timageURL : $imageURL\n") append("\tcolor : $color\n") @@ -40,17 +42,17 @@ class ContentLauncherClusterStyleInformationStruct( tlvWriter.apply { startStructure(tag) if (imageURL.isPresent) { - val optimageURL = imageURL.get() - put(ContextSpecificTag(TAG_IMAGE_U_R_L), optimageURL) - } + val optimageURL = imageURL.get() + put(ContextSpecificTag(TAG_IMAGE_U_R_L), optimageURL) + } if (color.isPresent) { - val optcolor = color.get() - put(ContextSpecificTag(TAG_COLOR), optcolor) - } + val optcolor = color.get() + put(ContextSpecificTag(TAG_COLOR), optcolor) + } if (size.isPresent) { - val optsize = size.get() - optsize.toTlv(ContextSpecificTag(TAG_SIZE), this) - } + val optsize = size.get() + optsize.toTlv(ContextSpecificTag(TAG_SIZE), this) + } endStructure() } } @@ -60,29 +62,24 @@ class ContentLauncherClusterStyleInformationStruct( private const val TAG_COLOR = 1 private const val TAG_SIZE = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterStyleInformationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterStyleInformationStruct { tlvReader.enterStructure(tag) - val imageURL = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_U_R_L))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_IMAGE_U_R_L))) - } else { - Optional.empty() - } - val color = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) - } else { - Optional.empty() - } - val size = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_SIZE))) { - Optional.of( - ContentLauncherClusterDimensionStruct.fromTlv(ContextSpecificTag(TAG_SIZE), tlvReader) - ) - } else { - Optional.empty() - } - + val imageURL = if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_U_R_L))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_IMAGE_U_R_L))) + } else { + Optional.empty() + } + val color = if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) + } else { + Optional.empty() + } + val size = if (tlvReader.isNextTag(ContextSpecificTag(TAG_SIZE))) { + Optional.of(ContentLauncherClusterDimensionStruct.fromTlv(ContextSpecificTag(TAG_SIZE), tlvReader)) + } else { + Optional.empty() + } + tlvReader.exitContainer() return ContentLauncherClusterStyleInformationStruct(imageURL, color, size) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt index 75fed36957e726..d76de77105ded9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DescriptorClusterDeviceTypeStruct(val deviceType: Long, val revision: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class DescriptorClusterDeviceTypeStruct ( + val deviceType: Long, + val revision: Int) { + override fun toString(): String = buildString { append("DescriptorClusterDeviceTypeStruct {\n") append("\tdeviceType : $deviceType\n") append("\trevision : $revision\n") @@ -43,11 +49,11 @@ class DescriptorClusterDeviceTypeStruct(val deviceType: Long, val revision: Int) private const val TAG_DEVICE_TYPE = 0 private const val TAG_REVISION = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DescriptorClusterDeviceTypeStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DescriptorClusterDeviceTypeStruct { tlvReader.enterStructure(tag) val deviceType = tlvReader.getLong(ContextSpecificTag(TAG_DEVICE_TYPE)) val revision = tlvReader.getInt(ContextSpecificTag(TAG_REVISION)) - + tlvReader.exitContainer() return DescriptorClusterDeviceTypeStruct(deviceType, revision) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt index abde881ccffcea..8c5fc527b8a5e5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt @@ -17,19 +17,21 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class DescriptorClusterSemanticTagStruct( - val mfgCode: Int?, - val namespaceID: Int, - val tag: Int, - val label: Optional? -) { - override fun toString(): String = buildString { +class DescriptorClusterSemanticTagStruct ( + val mfgCode: Int?, + val namespaceID: Int, + val tag: Int, + val label: Optional?) { + override fun toString(): String = buildString { append("DescriptorClusterSemanticTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tnamespaceID : $namespaceID\n") @@ -42,20 +44,20 @@ class DescriptorClusterSemanticTagStruct( tlvWriter.apply { startStructure(tag) if (mfgCode != null) { - put(ContextSpecificTag(TAG_MFG_CODE), mfgCode) - } else { - putNull(ContextSpecificTag(TAG_MFG_CODE)) - } + put(ContextSpecificTag(TAG_MFG_CODE), mfgCode) + } else { + putNull(ContextSpecificTag(TAG_MFG_CODE)) + } put(ContextSpecificTag(TAG_NAMESPACE_I_D), namespaceID) put(ContextSpecificTag(TAG_TAG), tag) if (label != null) { - if (label.isPresent) { - val optlabel = label.get() - put(ContextSpecificTag(TAG_LABEL), optlabel) - } - } else { - putNull(ContextSpecificTag(TAG_LABEL)) - } + if (label.isPresent) { + val optlabel = label.get() + put(ContextSpecificTag(TAG_LABEL), optlabel) + } + } else { + putNull(ContextSpecificTag(TAG_LABEL)) + } endStructure() } } @@ -66,29 +68,27 @@ class DescriptorClusterSemanticTagStruct( private const val TAG_TAG = 2 private const val TAG_LABEL = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DescriptorClusterSemanticTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DescriptorClusterSemanticTagStruct { tlvReader.enterStructure(tag) - val mfgCode = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_MFG_CODE)) - null - } + val mfgCode = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MFG_CODE)) + null + } val namespaceID = tlvReader.getInt(ContextSpecificTag(TAG_NAMESPACE_I_D)) val tag = tlvReader.getInt(ContextSpecificTag(TAG_TAG)) - val label = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LABEL))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LABEL)) - null - } - + val label = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LABEL))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LABEL)) + null + } + tlvReader.exitContainer() return DescriptorClusterSemanticTagStruct(mfgCode, namespaceID, tag, label) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt index 423d6a554672ce..d7004fbfc53590 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt @@ -20,15 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DishwasherModeClusterModeOptionStruct( - val label: String, - val mode: Int, - val modeTags: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class DishwasherModeClusterModeOptionStruct ( + val label: String, + val mode: Int, + val modeTags: List) { + override fun toString(): String = buildString { append("DishwasherModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -55,19 +57,18 @@ class DishwasherModeClusterModeOptionStruct( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DishwasherModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DishwasherModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while (!tlvReader.isEndOfContainer()) { - add(DishwasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while(!tlvReader.isEndOfContainer()) { + add(DishwasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return DishwasherModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt index 33881f4ac00c8d..110964c9ed2cf6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt @@ -17,14 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class DishwasherModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { - override fun toString(): String = buildString { +class DishwasherModeClusterModeTagStruct ( + val mfgCode: Optional, + val value: Int) { + override fun toString(): String = buildString { append("DishwasherModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -35,9 +40,9 @@ class DishwasherModeClusterModeTagStruct(val mfgCode: Optional, val value: tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -47,16 +52,15 @@ class DishwasherModeClusterModeTagStruct(val mfgCode: Optional, val value: private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DishwasherModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DishwasherModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return DishwasherModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt index da3a551267eb09..de3654516fc946 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class DoorLockClusterCredentialStruct(val credentialType: Int, val credentialIndex: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class DoorLockClusterCredentialStruct ( + val credentialType: Int, + val credentialIndex: Int) { + override fun toString(): String = buildString { append("DoorLockClusterCredentialStruct {\n") append("\tcredentialType : $credentialType\n") append("\tcredentialIndex : $credentialIndex\n") @@ -43,11 +49,11 @@ class DoorLockClusterCredentialStruct(val credentialType: Int, val credentialInd private const val TAG_CREDENTIAL_TYPE = 0 private const val TAG_CREDENTIAL_INDEX = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterCredentialStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterCredentialStruct { tlvReader.enterStructure(tag) val credentialType = tlvReader.getInt(ContextSpecificTag(TAG_CREDENTIAL_TYPE)) val credentialIndex = tlvReader.getInt(ContextSpecificTag(TAG_CREDENTIAL_INDEX)) - + tlvReader.exitContainer() return DoorLockClusterCredentialStruct(credentialType, credentialIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt index 09292f726d9467..16567ccab1ce30 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class FixedLabelClusterLabelStruct(val label: String, val value: String) { - override fun toString(): String = buildString { +import java.util.Optional + +class FixedLabelClusterLabelStruct ( + val label: String, + val value: String) { + override fun toString(): String = buildString { append("FixedLabelClusterLabelStruct {\n") append("\tlabel : $label\n") append("\tvalue : $value\n") @@ -43,11 +49,11 @@ class FixedLabelClusterLabelStruct(val label: String, val value: String) { private const val TAG_LABEL = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): FixedLabelClusterLabelStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : FixedLabelClusterLabelStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return FixedLabelClusterLabelStruct(label, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt index 60d10b41112a9d..2153c5ea32fc7d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GeneralCommissioningClusterBasicCommissioningInfo( - val failSafeExpiryLengthSeconds: Int, - val maxCumulativeFailsafeSeconds: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GeneralCommissioningClusterBasicCommissioningInfo ( + val failSafeExpiryLengthSeconds: Int, + val maxCumulativeFailsafeSeconds: Int) { + override fun toString(): String = buildString { append("GeneralCommissioningClusterBasicCommissioningInfo {\n") append("\tfailSafeExpiryLengthSeconds : $failSafeExpiryLengthSeconds\n") append("\tmaxCumulativeFailsafeSeconds : $maxCumulativeFailsafeSeconds\n") @@ -46,19 +49,14 @@ class GeneralCommissioningClusterBasicCommissioningInfo( private const val TAG_FAIL_SAFE_EXPIRY_LENGTH_SECONDS = 0 private const val TAG_MAX_CUMULATIVE_FAILSAFE_SECONDS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralCommissioningClusterBasicCommissioningInfo { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralCommissioningClusterBasicCommissioningInfo { tlvReader.enterStructure(tag) - val failSafeExpiryLengthSeconds = - tlvReader.getInt(ContextSpecificTag(TAG_FAIL_SAFE_EXPIRY_LENGTH_SECONDS)) - val maxCumulativeFailsafeSeconds = - tlvReader.getInt(ContextSpecificTag(TAG_MAX_CUMULATIVE_FAILSAFE_SECONDS)) - + val failSafeExpiryLengthSeconds = tlvReader.getInt(ContextSpecificTag(TAG_FAIL_SAFE_EXPIRY_LENGTH_SECONDS)) + val maxCumulativeFailsafeSeconds = tlvReader.getInt(ContextSpecificTag(TAG_MAX_CUMULATIVE_FAILSAFE_SECONDS)) + tlvReader.exitContainer() - return GeneralCommissioningClusterBasicCommissioningInfo( - failSafeExpiryLengthSeconds, - maxCumulativeFailsafeSeconds - ) + return GeneralCommissioningClusterBasicCommissioningInfo(failSafeExpiryLengthSeconds, maxCumulativeFailsafeSeconds) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt index d4ff313520e65e..2813b085912e48 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt @@ -20,20 +20,22 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GeneralDiagnosticsClusterNetworkInterface( - val name: String, - val isOperational: Boolean, - val offPremiseServicesReachableIPv4: Boolean?, - val offPremiseServicesReachableIPv6: Boolean?, - val hardwareAddress: ByteArray, - val IPv4Addresses: List, - val IPv6Addresses: List, - val type: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GeneralDiagnosticsClusterNetworkInterface ( + val name: String, + val isOperational: Boolean, + val offPremiseServicesReachableIPv4: Boolean?, + val offPremiseServicesReachableIPv6: Boolean?, + val hardwareAddress: ByteArray, + val IPv4Addresses: List, + val IPv6Addresses: List, + val type: Int) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterNetworkInterface {\n") append("\tname : $name\n") append("\tisOperational : $isOperational\n") @@ -52,21 +54,15 @@ class GeneralDiagnosticsClusterNetworkInterface( put(ContextSpecificTag(TAG_NAME), name) put(ContextSpecificTag(TAG_IS_OPERATIONAL), isOperational) if (offPremiseServicesReachableIPv4 != null) { - put( - ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4), - offPremiseServicesReachableIPv4 - ) - } else { - putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) - } + put(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4), offPremiseServicesReachableIPv4) + } else { + putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) + } if (offPremiseServicesReachableIPv6 != null) { - put( - ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6), - offPremiseServicesReachableIPv6 - ) - } else { - putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) - } + put(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6), offPremiseServicesReachableIPv6) + } else { + putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) + } put(ContextSpecificTag(TAG_HARDWARE_ADDRESS), hardwareAddress) startList(ContextSpecificTag(TAG_I_PV4_ADDRESSES)) for (item in IPv4Addresses.iterator()) { @@ -93,55 +89,42 @@ class GeneralDiagnosticsClusterNetworkInterface( private const val TAG_I_PV6_ADDRESSES = 6 private const val TAG_TYPE = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterNetworkInterface { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterNetworkInterface { tlvReader.enterStructure(tag) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val isOperational = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_OPERATIONAL)) - val offPremiseServicesReachableIPv4 = - if (!tlvReader.isNull()) { - tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) - null - } - val offPremiseServicesReachableIPv6 = - if (!tlvReader.isNull()) { - tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) - null - } + val offPremiseServicesReachableIPv4 = if (!tlvReader.isNull()) { + tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) + null + } + val offPremiseServicesReachableIPv6 = if (!tlvReader.isNull()) { + tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) + null + } val hardwareAddress = tlvReader.getByteArray(ContextSpecificTag(TAG_HARDWARE_ADDRESS)) - val IPv4Addresses = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_I_PV4_ADDRESSES)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getByteArray(AnonymousTag)) - } - tlvReader.exitContainer() - } - val IPv6Addresses = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_I_PV6_ADDRESSES)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getByteArray(AnonymousTag)) - } - tlvReader.exitContainer() - } + val IPv4Addresses = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_I_PV4_ADDRESSES)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getByteArray(AnonymousTag)) + } + tlvReader.exitContainer() + } + val IPv6Addresses = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_I_PV6_ADDRESSES)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getByteArray(AnonymousTag)) + } + tlvReader.exitContainer() + } val type = tlvReader.getInt(ContextSpecificTag(TAG_TYPE)) - + tlvReader.exitContainer() - return GeneralDiagnosticsClusterNetworkInterface( - name, - isOperational, - offPremiseServicesReachableIPv4, - offPremiseServicesReachableIPv6, - hardwareAddress, - IPv4Addresses, - IPv6Addresses, - type - ) + return GeneralDiagnosticsClusterNetworkInterface(name, isOperational, offPremiseServicesReachableIPv4, offPremiseServicesReachableIPv6, hardwareAddress, IPv4Addresses, IPv6Addresses, type) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt index 6038b55d345b75..c6ecaa9eb20014 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt @@ -20,17 +20,18 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class GroupKeyManagementClusterGroupInfoMapStruct( - val groupId: Int, - val endpoints: List, - val groupName: Optional, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +class GroupKeyManagementClusterGroupInfoMapStruct ( + val groupId: Int, + val endpoints: List, + val groupName: Optional, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("GroupKeyManagementClusterGroupInfoMapStruct {\n") append("\tgroupId : $groupId\n") append("\tendpoints : $endpoints\n") @@ -49,9 +50,9 @@ class GroupKeyManagementClusterGroupInfoMapStruct( } endList() if (groupName.isPresent) { - val optgroupName = groupName.get() - put(ContextSpecificTag(TAG_GROUP_NAME), optgroupName) - } + val optgroupName = groupName.get() + put(ContextSpecificTag(TAG_GROUP_NAME), optgroupName) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -63,25 +64,23 @@ class GroupKeyManagementClusterGroupInfoMapStruct( private const val TAG_GROUP_NAME = 3 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GroupKeyManagementClusterGroupInfoMapStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GroupKeyManagementClusterGroupInfoMapStruct { tlvReader.enterStructure(tag) val groupId = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_ID)) - val endpoints = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val groupName = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_GROUP_NAME))) - } else { - Optional.empty() - } + val endpoints = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val groupName = if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_GROUP_NAME))) + } else { + Optional.empty() + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return GroupKeyManagementClusterGroupInfoMapStruct(groupId, endpoints, groupName, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt index d565d70233abc2..8e692ad743b3c1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GroupKeyManagementClusterGroupKeyMapStruct( - val groupId: Int, - val groupKeySetID: Int, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GroupKeyManagementClusterGroupKeyMapStruct ( + val groupId: Int, + val groupKeySetID: Int, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("GroupKeyManagementClusterGroupKeyMapStruct {\n") append("\tgroupId : $groupId\n") append("\tgroupKeySetID : $groupKeySetID\n") @@ -50,12 +53,12 @@ class GroupKeyManagementClusterGroupKeyMapStruct( private const val TAG_GROUP_KEY_SET_I_D = 2 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GroupKeyManagementClusterGroupKeyMapStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GroupKeyManagementClusterGroupKeyMapStruct { tlvReader.enterStructure(tag) val groupId = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_ID)) val groupKeySetID = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SET_I_D)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return GroupKeyManagementClusterGroupKeyMapStruct(groupId, groupKeySetID, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt index 418b6037ae46c9..0af577bdf3cdce 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt @@ -17,22 +17,25 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class GroupKeyManagementClusterGroupKeySetStruct( - val groupKeySetID: Int, - val groupKeySecurityPolicy: Int, - val epochKey0: ByteArray?, - val epochStartTime0: Long?, - val epochKey1: ByteArray?, - val epochStartTime1: Long?, - val epochKey2: ByteArray?, - val epochStartTime2: Long? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class GroupKeyManagementClusterGroupKeySetStruct ( + val groupKeySetID: Int, + val groupKeySecurityPolicy: Int, + val epochKey0: ByteArray?, + val epochStartTime0: Long?, + val epochKey1: ByteArray?, + val epochStartTime1: Long?, + val epochKey2: ByteArray?, + val epochStartTime2: Long?) { + override fun toString(): String = buildString { append("GroupKeyManagementClusterGroupKeySetStruct {\n") append("\tgroupKeySetID : $groupKeySetID\n") append("\tgroupKeySecurityPolicy : $groupKeySecurityPolicy\n") @@ -51,35 +54,35 @@ class GroupKeyManagementClusterGroupKeySetStruct( put(ContextSpecificTag(TAG_GROUP_KEY_SET_I_D), groupKeySetID) put(ContextSpecificTag(TAG_GROUP_KEY_SECURITY_POLICY), groupKeySecurityPolicy) if (epochKey0 != null) { - put(ContextSpecificTag(TAG_EPOCH_KEY0), epochKey0) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_KEY0)) - } + put(ContextSpecificTag(TAG_EPOCH_KEY0), epochKey0) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_KEY0)) + } if (epochStartTime0 != null) { - put(ContextSpecificTag(TAG_EPOCH_START_TIME0), epochStartTime0) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) - } + put(ContextSpecificTag(TAG_EPOCH_START_TIME0), epochStartTime0) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) + } if (epochKey1 != null) { - put(ContextSpecificTag(TAG_EPOCH_KEY1), epochKey1) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_KEY1)) - } + put(ContextSpecificTag(TAG_EPOCH_KEY1), epochKey1) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_KEY1)) + } if (epochStartTime1 != null) { - put(ContextSpecificTag(TAG_EPOCH_START_TIME1), epochStartTime1) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) - } + put(ContextSpecificTag(TAG_EPOCH_START_TIME1), epochStartTime1) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) + } if (epochKey2 != null) { - put(ContextSpecificTag(TAG_EPOCH_KEY2), epochKey2) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_KEY2)) - } + put(ContextSpecificTag(TAG_EPOCH_KEY2), epochKey2) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_KEY2)) + } if (epochStartTime2 != null) { - put(ContextSpecificTag(TAG_EPOCH_START_TIME2), epochStartTime2) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) - } + put(ContextSpecificTag(TAG_EPOCH_START_TIME2), epochStartTime2) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) + } endStructure() } } @@ -94,66 +97,50 @@ class GroupKeyManagementClusterGroupKeySetStruct( private const val TAG_EPOCH_KEY2 = 6 private const val TAG_EPOCH_START_TIME2 = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader): GroupKeyManagementClusterGroupKeySetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : GroupKeyManagementClusterGroupKeySetStruct { tlvReader.enterStructure(tag) val groupKeySetID = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SET_I_D)) - val groupKeySecurityPolicy = - tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SECURITY_POLICY)) - val epochKey0 = - if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY0)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY0)) - null - } - val epochStartTime0 = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME0)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) - null - } - val epochKey1 = - if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY1)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY1)) - null - } - val epochStartTime1 = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME1)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) - null - } - val epochKey2 = - if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY2)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY2)) - null - } - val epochStartTime2 = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME2)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) - null - } - + val groupKeySecurityPolicy = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SECURITY_POLICY)) + val epochKey0 = if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY0)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY0)) + null + } + val epochStartTime0 = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME0)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) + null + } + val epochKey1 = if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY1)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY1)) + null + } + val epochStartTime1 = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME1)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) + null + } + val epochKey2 = if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY2)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY2)) + null + } + val epochStartTime2 = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME2)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) + null + } + tlvReader.exitContainer() - return GroupKeyManagementClusterGroupKeySetStruct( - groupKeySetID, - groupKeySecurityPolicy, - epochKey0, - epochStartTime0, - epochKey1, - epochStartTime1, - epochKey2, - epochStartTime2 - ) + return GroupKeyManagementClusterGroupKeySetStruct(groupKeySetID, groupKeySecurityPolicy, epochKey0, epochStartTime0, epochKey1, epochStartTime1, epochKey2, epochStartTime2) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt index a86ba8db2dee0a..9ecba7669d8e6f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class HepaFilterMonitoringClusterReplacementProductStruct( - val productIdentifierType: Int, - val productIdentifierValue: String -) { - override fun toString(): String = buildString { +import java.util.Optional + +class HepaFilterMonitoringClusterReplacementProductStruct ( + val productIdentifierType: Int, + val productIdentifierValue: String) { + override fun toString(): String = buildString { append("HepaFilterMonitoringClusterReplacementProductStruct {\n") append("\tproductIdentifierType : $productIdentifierType\n") append("\tproductIdentifierValue : $productIdentifierValue\n") @@ -46,21 +49,14 @@ class HepaFilterMonitoringClusterReplacementProductStruct( private const val TAG_PRODUCT_IDENTIFIER_TYPE = 0 private const val TAG_PRODUCT_IDENTIFIER_VALUE = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): HepaFilterMonitoringClusterReplacementProductStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : HepaFilterMonitoringClusterReplacementProductStruct { tlvReader.enterStructure(tag) val productIdentifierType = tlvReader.getInt(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_TYPE)) - val productIdentifierValue = - tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) - + val productIdentifierValue = tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) + tlvReader.exitContainer() - return HepaFilterMonitoringClusterReplacementProductStruct( - productIdentifierType, - productIdentifierValue - ) + return HepaFilterMonitoringClusterReplacementProductStruct(productIdentifierType, productIdentifierValue) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt index d380689bed016f..ebef1ce2ce74a7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class IcdManagementClusterMonitoringRegistrationStruct( - val checkInNodeID: Long, - val monitoredSubject: Long, - val key: ByteArray, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class IcdManagementClusterMonitoringRegistrationStruct ( + val checkInNodeID: Long, + val monitoredSubject: Long, + val key: ByteArray, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("IcdManagementClusterMonitoringRegistrationStruct {\n") append("\tcheckInNodeID : $checkInNodeID\n") append("\tmonitoredSubject : $monitoredSubject\n") @@ -54,21 +57,16 @@ class IcdManagementClusterMonitoringRegistrationStruct( private const val TAG_KEY = 3 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): IcdManagementClusterMonitoringRegistrationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : IcdManagementClusterMonitoringRegistrationStruct { tlvReader.enterStructure(tag) val checkInNodeID = tlvReader.getLong(ContextSpecificTag(TAG_CHECK_IN_NODE_I_D)) val monitoredSubject = tlvReader.getLong(ContextSpecificTag(TAG_MONITORED_SUBJECT)) val key = tlvReader.getByteArray(ContextSpecificTag(TAG_KEY)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return IcdManagementClusterMonitoringRegistrationStruct( - checkInNodeID, - monitoredSubject, - key, - fabricIndex - ) + return IcdManagementClusterMonitoringRegistrationStruct(checkInNodeID, monitoredSubject, key, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt index eeab9e95eb7cce..91f733b2bf8edd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt @@ -20,15 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class LaundryWasherModeClusterModeOptionStruct( - val label: String, - val mode: Int, - val modeTags: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class LaundryWasherModeClusterModeOptionStruct ( + val label: String, + val mode: Int, + val modeTags: List) { + override fun toString(): String = buildString { append("LaundryWasherModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -55,19 +57,18 @@ class LaundryWasherModeClusterModeOptionStruct( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): LaundryWasherModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : LaundryWasherModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while (!tlvReader.isEndOfContainer()) { - add(LaundryWasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while(!tlvReader.isEndOfContainer()) { + add(LaundryWasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return LaundryWasherModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt index eed09912c26a9c..06685de8506c7d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt @@ -17,14 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class LaundryWasherModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { - override fun toString(): String = buildString { +class LaundryWasherModeClusterModeTagStruct ( + val mfgCode: Optional, + val value: Int) { + override fun toString(): String = buildString { append("LaundryWasherModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -35,9 +40,9 @@ class LaundryWasherModeClusterModeTagStruct(val mfgCode: Optional, val valu tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -47,16 +52,15 @@ class LaundryWasherModeClusterModeTagStruct(val mfgCode: Optional, val valu private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): LaundryWasherModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : LaundryWasherModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return LaundryWasherModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt index 514c05d19f6fdf..7be50d0dbc9ad3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt @@ -17,18 +17,21 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class MediaInputClusterInputInfoStruct( - val index: Int, - val inputType: Int, - val name: String, - val description: String -) { - override fun toString(): String = buildString { +import java.util.Optional + +class MediaInputClusterInputInfoStruct ( + val index: Int, + val inputType: Int, + val name: String, + val description: String) { + override fun toString(): String = buildString { append("MediaInputClusterInputInfoStruct {\n") append("\tindex : $index\n") append("\tinputType : $inputType\n") @@ -54,13 +57,13 @@ class MediaInputClusterInputInfoStruct( private const val TAG_NAME = 2 private const val TAG_DESCRIPTION = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader): MediaInputClusterInputInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : MediaInputClusterInputInfoStruct { tlvReader.enterStructure(tag) val index = tlvReader.getInt(ContextSpecificTag(TAG_INDEX)) val inputType = tlvReader.getInt(ContextSpecificTag(TAG_INPUT_TYPE)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val description = tlvReader.getString(ContextSpecificTag(TAG_DESCRIPTION)) - + tlvReader.exitContainer() return MediaInputClusterInputInfoStruct(index, inputType, name, description) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt index d452d083a73112..6b6e8cfcf12403 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class MediaPlaybackClusterPlaybackPositionStruct(val updatedAt: Long, val position: Long?) { - override fun toString(): String = buildString { +import java.util.Optional + +class MediaPlaybackClusterPlaybackPositionStruct ( + val updatedAt: Long, + val position: Long?) { + override fun toString(): String = buildString { append("MediaPlaybackClusterPlaybackPositionStruct {\n") append("\tupdatedAt : $updatedAt\n") append("\tposition : $position\n") @@ -35,10 +41,10 @@ class MediaPlaybackClusterPlaybackPositionStruct(val updatedAt: Long, val positi startStructure(tag) put(ContextSpecificTag(TAG_UPDATED_AT), updatedAt) if (position != null) { - put(ContextSpecificTag(TAG_POSITION), position) - } else { - putNull(ContextSpecificTag(TAG_POSITION)) - } + put(ContextSpecificTag(TAG_POSITION), position) + } else { + putNull(ContextSpecificTag(TAG_POSITION)) + } endStructure() } } @@ -47,17 +53,16 @@ class MediaPlaybackClusterPlaybackPositionStruct(val updatedAt: Long, val positi private const val TAG_UPDATED_AT = 0 private const val TAG_POSITION = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): MediaPlaybackClusterPlaybackPositionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : MediaPlaybackClusterPlaybackPositionStruct { tlvReader.enterStructure(tag) val updatedAt = tlvReader.getLong(ContextSpecificTag(TAG_UPDATED_AT)) - val position = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_POSITION)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_POSITION)) - null - } - + val position = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_POSITION)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_POSITION)) + null + } + tlvReader.exitContainer() return MediaPlaybackClusterPlaybackPositionStruct(updatedAt, position) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt index ac95817519112f..eacbd43215cc6c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt @@ -20,15 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ModeSelectClusterModeOptionStruct( - val label: String, - val mode: Int, - val semanticTags: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ModeSelectClusterModeOptionStruct ( + val label: String, + val mode: Int, + val semanticTags: List) { + override fun toString(): String = buildString { append("ModeSelectClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -55,19 +57,18 @@ class ModeSelectClusterModeOptionStruct( private const val TAG_MODE = 1 private const val TAG_SEMANTIC_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ModeSelectClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ModeSelectClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val semanticTags = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_SEMANTIC_TAGS)) - while (!tlvReader.isEndOfContainer()) { - add(ModeSelectClusterSemanticTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val semanticTags = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_SEMANTIC_TAGS)) + while(!tlvReader.isEndOfContainer()) { + add(ModeSelectClusterSemanticTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ModeSelectClusterModeOptionStruct(label, mode, semanticTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt index 04c893671659d3..6e00f596b61ebf 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ModeSelectClusterSemanticTagStruct(val mfgCode: Int, val value: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class ModeSelectClusterSemanticTagStruct ( + val mfgCode: Int, + val value: Int) { + override fun toString(): String = buildString { append("ModeSelectClusterSemanticTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -43,11 +49,11 @@ class ModeSelectClusterSemanticTagStruct(val mfgCode: Int, val value: Int) { private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ModeSelectClusterSemanticTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ModeSelectClusterSemanticTagStruct { tlvReader.enterStructure(tag) val mfgCode = tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE)) val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return ModeSelectClusterSemanticTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt index 8b942f2a492dd1..9cf40b7e7ce7a3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class NetworkCommissioningClusterNetworkInfoStruct( - val networkID: ByteArray, - val connected: Boolean -) { - override fun toString(): String = buildString { +import java.util.Optional + +class NetworkCommissioningClusterNetworkInfoStruct ( + val networkID: ByteArray, + val connected: Boolean) { + override fun toString(): String = buildString { append("NetworkCommissioningClusterNetworkInfoStruct {\n") append("\tnetworkID : $networkID\n") append("\tconnected : $connected\n") @@ -46,11 +49,11 @@ class NetworkCommissioningClusterNetworkInfoStruct( private const val TAG_NETWORK_I_D = 0 private const val TAG_CONNECTED = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): NetworkCommissioningClusterNetworkInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : NetworkCommissioningClusterNetworkInfoStruct { tlvReader.enterStructure(tag) val networkID = tlvReader.getByteArray(ContextSpecificTag(TAG_NETWORK_I_D)) val connected = tlvReader.getBoolean(ContextSpecificTag(TAG_CONNECTED)) - + tlvReader.exitContainer() return NetworkCommissioningClusterNetworkInfoStruct(networkID, connected) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt index 76593b32131477..e8cc5c1941d7d8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt @@ -17,22 +17,25 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class NetworkCommissioningClusterThreadInterfaceScanResultStruct( - val panId: Int, - val extendedPanId: Long, - val networkName: String, - val channel: Int, - val version: Int, - val extendedAddress: ByteArray, - val rssi: Int, - val lqi: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class NetworkCommissioningClusterThreadInterfaceScanResultStruct ( + val panId: Int, + val extendedPanId: Long, + val networkName: String, + val channel: Int, + val version: Int, + val extendedAddress: ByteArray, + val rssi: Int, + val lqi: Int) { + override fun toString(): String = buildString { append("NetworkCommissioningClusterThreadInterfaceScanResultStruct {\n") append("\tpanId : $panId\n") append("\textendedPanId : $extendedPanId\n") @@ -70,10 +73,7 @@ class NetworkCommissioningClusterThreadInterfaceScanResultStruct( private const val TAG_RSSI = 6 private const val TAG_LQI = 7 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): NetworkCommissioningClusterThreadInterfaceScanResultStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : NetworkCommissioningClusterThreadInterfaceScanResultStruct { tlvReader.enterStructure(tag) val panId = tlvReader.getInt(ContextSpecificTag(TAG_PAN_ID)) val extendedPanId = tlvReader.getLong(ContextSpecificTag(TAG_EXTENDED_PAN_ID)) @@ -83,19 +83,10 @@ class NetworkCommissioningClusterThreadInterfaceScanResultStruct( val extendedAddress = tlvReader.getByteArray(ContextSpecificTag(TAG_EXTENDED_ADDRESS)) val rssi = tlvReader.getInt(ContextSpecificTag(TAG_RSSI)) val lqi = tlvReader.getInt(ContextSpecificTag(TAG_LQI)) - + tlvReader.exitContainer() - return NetworkCommissioningClusterThreadInterfaceScanResultStruct( - panId, - extendedPanId, - networkName, - channel, - version, - extendedAddress, - rssi, - lqi - ) + return NetworkCommissioningClusterThreadInterfaceScanResultStruct(panId, extendedPanId, networkName, channel, version, extendedAddress, rssi, lqi) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt index d2cf4bcf5b7cb0..efcd50f0c17fba 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt @@ -17,20 +17,23 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class NetworkCommissioningClusterWiFiInterfaceScanResultStruct( - val security: Int, - val ssid: ByteArray, - val bssid: ByteArray, - val channel: Int, - val wiFiBand: Int, - val rssi: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class NetworkCommissioningClusterWiFiInterfaceScanResultStruct ( + val security: Int, + val ssid: ByteArray, + val bssid: ByteArray, + val channel: Int, + val wiFiBand: Int, + val rssi: Int) { + override fun toString(): String = buildString { append("NetworkCommissioningClusterWiFiInterfaceScanResultStruct {\n") append("\tsecurity : $security\n") append("\tssid : $ssid\n") @@ -62,10 +65,7 @@ class NetworkCommissioningClusterWiFiInterfaceScanResultStruct( private const val TAG_WI_FI_BAND = 4 private const val TAG_RSSI = 5 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): NetworkCommissioningClusterWiFiInterfaceScanResultStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : NetworkCommissioningClusterWiFiInterfaceScanResultStruct { tlvReader.enterStructure(tag) val security = tlvReader.getInt(ContextSpecificTag(TAG_SECURITY)) val ssid = tlvReader.getByteArray(ContextSpecificTag(TAG_SSID)) @@ -73,17 +73,10 @@ class NetworkCommissioningClusterWiFiInterfaceScanResultStruct( val channel = tlvReader.getInt(ContextSpecificTag(TAG_CHANNEL)) val wiFiBand = tlvReader.getInt(ContextSpecificTag(TAG_WI_FI_BAND)) val rssi = tlvReader.getInt(ContextSpecificTag(TAG_RSSI)) - + tlvReader.exitContainer() - return NetworkCommissioningClusterWiFiInterfaceScanResultStruct( - security, - ssid, - bssid, - channel, - wiFiBand, - rssi - ) + return NetworkCommissioningClusterWiFiInterfaceScanResultStruct(security, ssid, bssid, channel, wiFiBand, rssi) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt index 8264e9fa5ee545..620c17f8cd0863 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt @@ -17,20 +17,23 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OperationalCredentialsClusterFabricDescriptorStruct( - val rootPublicKey: ByteArray, - val vendorID: Int, - val fabricID: Long, - val nodeID: Long, - val label: String, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OperationalCredentialsClusterFabricDescriptorStruct ( + val rootPublicKey: ByteArray, + val vendorID: Int, + val fabricID: Long, + val nodeID: Long, + val label: String, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("OperationalCredentialsClusterFabricDescriptorStruct {\n") append("\trootPublicKey : $rootPublicKey\n") append("\tvendorID : $vendorID\n") @@ -62,10 +65,7 @@ class OperationalCredentialsClusterFabricDescriptorStruct( private const val TAG_LABEL = 5 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): OperationalCredentialsClusterFabricDescriptorStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalCredentialsClusterFabricDescriptorStruct { tlvReader.enterStructure(tag) val rootPublicKey = tlvReader.getByteArray(ContextSpecificTag(TAG_ROOT_PUBLIC_KEY)) val vendorID = tlvReader.getInt(ContextSpecificTag(TAG_VENDOR_I_D)) @@ -73,17 +73,10 @@ class OperationalCredentialsClusterFabricDescriptorStruct( val nodeID = tlvReader.getLong(ContextSpecificTag(TAG_NODE_I_D)) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return OperationalCredentialsClusterFabricDescriptorStruct( - rootPublicKey, - vendorID, - fabricID, - nodeID, - label, - fabricIndex - ) + return OperationalCredentialsClusterFabricDescriptorStruct(rootPublicKey, vendorID, fabricID, nodeID, label, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt index a05f388d1a5e06..406bad431f78c9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OperationalCredentialsClusterNOCStruct( - val noc: ByteArray, - val icac: ByteArray?, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OperationalCredentialsClusterNOCStruct ( + val noc: ByteArray, + val icac: ByteArray?, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("OperationalCredentialsClusterNOCStruct {\n") append("\tnoc : $noc\n") append("\ticac : $icac\n") @@ -40,10 +43,10 @@ class OperationalCredentialsClusterNOCStruct( startStructure(tag) put(ContextSpecificTag(TAG_NOC), noc) if (icac != null) { - put(ContextSpecificTag(TAG_ICAC), icac) - } else { - putNull(ContextSpecificTag(TAG_ICAC)) - } + put(ContextSpecificTag(TAG_ICAC), icac) + } else { + putNull(ContextSpecificTag(TAG_ICAC)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -54,18 +57,17 @@ class OperationalCredentialsClusterNOCStruct( private const val TAG_ICAC = 2 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalCredentialsClusterNOCStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalCredentialsClusterNOCStruct { tlvReader.enterStructure(tag) val noc = tlvReader.getByteArray(ContextSpecificTag(TAG_NOC)) - val icac = - if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_ICAC)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ICAC)) - null - } + val icac = if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_ICAC)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ICAC)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return OperationalCredentialsClusterNOCStruct(noc, icac, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt index cdbccac37fe63f..68879d32ff0bd1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class OperationalStateClusterErrorStateStruct( - val errorStateID: Int, - val errorStateLabel: Optional, - val errorStateDetails: Optional -) { - override fun toString(): String = buildString { +class OperationalStateClusterErrorStateStruct ( + val errorStateID: Int, + val errorStateLabel: Optional, + val errorStateDetails: Optional) { + override fun toString(): String = buildString { append("OperationalStateClusterErrorStateStruct {\n") append("\terrorStateID : $errorStateID\n") append("\terrorStateLabel : $errorStateLabel\n") @@ -41,13 +43,13 @@ class OperationalStateClusterErrorStateStruct( startStructure(tag) put(ContextSpecificTag(TAG_ERROR_STATE_I_D), errorStateID) if (errorStateLabel.isPresent) { - val opterrorStateLabel = errorStateLabel.get() - put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) - } + val opterrorStateLabel = errorStateLabel.get() + put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) + } if (errorStateDetails.isPresent) { - val opterrorStateDetails = errorStateDetails.get() - put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) - } + val opterrorStateDetails = errorStateDetails.get() + put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) + } endStructure() } } @@ -57,29 +59,23 @@ class OperationalStateClusterErrorStateStruct( private const val TAG_ERROR_STATE_LABEL = 1 private const val TAG_ERROR_STATE_DETAILS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterErrorStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterErrorStateStruct { tlvReader.enterStructure(tag) val errorStateID = tlvReader.getInt(ContextSpecificTag(TAG_ERROR_STATE_I_D)) - val errorStateLabel = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) - } else { - Optional.empty() - } - val errorStateDetails = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) - } else { - Optional.empty() - } - + val errorStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) + } else { + Optional.empty() + } + val errorStateDetails = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return OperationalStateClusterErrorStateStruct( - errorStateID, - errorStateLabel, - errorStateDetails - ) + return OperationalStateClusterErrorStateStruct(errorStateID, errorStateLabel, errorStateDetails) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt index 1c55ac8f8927c4..f66152a1cfb5f1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt @@ -17,17 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class OperationalStateClusterOperationalStateStruct( - val operationalStateID: Int, - val operationalStateLabel: Optional -) { - override fun toString(): String = buildString { +class OperationalStateClusterOperationalStateStruct ( + val operationalStateID: Int, + val operationalStateLabel: Optional) { + override fun toString(): String = buildString { append("OperationalStateClusterOperationalStateStruct {\n") append("\toperationalStateID : $operationalStateID\n") append("\toperationalStateLabel : $operationalStateLabel\n") @@ -39,9 +41,9 @@ class OperationalStateClusterOperationalStateStruct( startStructure(tag) put(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D), operationalStateID) if (operationalStateLabel.isPresent) { - val optoperationalStateLabel = operationalStateLabel.get() - put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) - } + val optoperationalStateLabel = operationalStateLabel.get() + put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) + } endStructure() } } @@ -50,22 +52,18 @@ class OperationalStateClusterOperationalStateStruct( private const val TAG_OPERATIONAL_STATE_I_D = 0 private const val TAG_OPERATIONAL_STATE_LABEL = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterOperationalStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterOperationalStateStruct { tlvReader.enterStructure(tag) val operationalStateID = tlvReader.getInt(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D)) - val operationalStateLabel = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) - } else { - Optional.empty() - } - + val operationalStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return OperationalStateClusterOperationalStateStruct( - operationalStateID, - operationalStateLabel - ) + return OperationalStateClusterOperationalStateStruct(operationalStateID, operationalStateLabel) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt index 17f95d897b258b..f527505ff87b22 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class OtaSoftwareUpdateRequestorClusterProviderLocation( - val providerNodeID: Long, - val endpoint: Int, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class OtaSoftwareUpdateRequestorClusterProviderLocation ( + val providerNodeID: Long, + val endpoint: Int, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterProviderLocation {\n") append("\tproviderNodeID : $providerNodeID\n") append("\tendpoint : $endpoint\n") @@ -50,19 +53,15 @@ class OtaSoftwareUpdateRequestorClusterProviderLocation( private const val TAG_ENDPOINT = 2 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): OtaSoftwareUpdateRequestorClusterProviderLocation { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterProviderLocation { tlvReader.enterStructure(tag) val providerNodeID = tlvReader.getLong(ContextSpecificTag(TAG_PROVIDER_NODE_I_D)) val endpoint = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return OtaSoftwareUpdateRequestorClusterProviderLocation( - providerNodeID, - endpoint, - fabricIndex - ) + return OtaSoftwareUpdateRequestorClusterProviderLocation(providerNodeID, endpoint, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt index 6172f21498fdb0..a3e342cf110c49 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt @@ -20,11 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class PowerSourceClusterBatChargeFaultChangeType(val current: List, val previous: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class PowerSourceClusterBatChargeFaultChangeType ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatChargeFaultChangeType {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -52,25 +57,23 @@ class PowerSourceClusterBatChargeFaultChangeType(val current: List, val pre private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatChargeFaultChangeType { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatChargeFaultChangeType { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatChargeFaultChangeType(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt index 6ef4a63074b8a2..4feef1564786b2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt @@ -20,11 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class PowerSourceClusterBatFaultChangeType(val current: List, val previous: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class PowerSourceClusterBatFaultChangeType ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatFaultChangeType {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -52,25 +57,23 @@ class PowerSourceClusterBatFaultChangeType(val current: List, val previous: private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatFaultChangeType { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatFaultChangeType { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatFaultChangeType(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt index 86cdc01f28fd41..6c99e0befd7e37 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt @@ -20,11 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class PowerSourceClusterWiredFaultChangeType(val current: List, val previous: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class PowerSourceClusterWiredFaultChangeType ( + val current: List, + val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterWiredFaultChangeType {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -52,25 +57,23 @@ class PowerSourceClusterWiredFaultChangeType(val current: List, val previou private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterWiredFaultChangeType { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterWiredFaultChangeType { tlvReader.enterStructure(tag) - val current = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterWiredFaultChangeType(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt index 6632b9581bb508..e3f52fc923d0e9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt @@ -20,15 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( - val label: String, - val mode: Int, - val modeTags: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct ( + val label: String, + val mode: Int, + val modeTags: List) { + override fun toString(): String = buildString { append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -55,34 +57,21 @@ class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while (!tlvReader.isEndOfContainer()) { - add( - RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.fromTlv( - AnonymousTag, - tlvReader - ) - ) - } - tlvReader.exitContainer() - } - + val modeTags = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while(!tlvReader.isEndOfContainer()) { + add(RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() - return RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( - label, - mode, - modeTags - ) + return RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct(label, mode, modeTags) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt index 9f806c52fa6fa2..7b3fc8ad89ac0a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt @@ -17,17 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct( - val mfgCode: Optional, - val value: Int -) { - override fun toString(): String = buildString { +class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct ( + val mfgCode: Optional, + val value: Int) { + override fun toString(): String = buildString { append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -38,9 +40,9 @@ class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct( tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -50,19 +52,15 @@ class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt index e3f33a1b7dcac5..986ef2fbfe7fae 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt @@ -20,15 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class RvcCleanModeClusterModeOptionStruct( - val label: String, - val mode: Int, - val modeTags: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class RvcCleanModeClusterModeOptionStruct ( + val label: String, + val mode: Int, + val modeTags: List) { + override fun toString(): String = buildString { append("RvcCleanModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -55,19 +57,18 @@ class RvcCleanModeClusterModeOptionStruct( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcCleanModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcCleanModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while (!tlvReader.isEndOfContainer()) { - add(RvcCleanModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while(!tlvReader.isEndOfContainer()) { + add(RvcCleanModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return RvcCleanModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt index bc7eb7ed818b41..d1b5786dd5004d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt @@ -17,14 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class RvcCleanModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { - override fun toString(): String = buildString { +class RvcCleanModeClusterModeTagStruct ( + val mfgCode: Optional, + val value: Int) { + override fun toString(): String = buildString { append("RvcCleanModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -35,9 +40,9 @@ class RvcCleanModeClusterModeTagStruct(val mfgCode: Optional, val value: In tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -47,16 +52,15 @@ class RvcCleanModeClusterModeTagStruct(val mfgCode: Optional, val value: In private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcCleanModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcCleanModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return RvcCleanModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt index f6b9b8b14456f0..9416a49dd8d2e1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class RvcOperationalStateClusterErrorStateStruct( - val errorStateID: Int, - val errorStateLabel: Optional, - val errorStateDetails: Optional -) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterErrorStateStruct ( + val errorStateID: Int, + val errorStateLabel: Optional, + val errorStateDetails: Optional) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterErrorStateStruct {\n") append("\terrorStateID : $errorStateID\n") append("\terrorStateLabel : $errorStateLabel\n") @@ -41,13 +43,13 @@ class RvcOperationalStateClusterErrorStateStruct( startStructure(tag) put(ContextSpecificTag(TAG_ERROR_STATE_I_D), errorStateID) if (errorStateLabel.isPresent) { - val opterrorStateLabel = errorStateLabel.get() - put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) - } + val opterrorStateLabel = errorStateLabel.get() + put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) + } if (errorStateDetails.isPresent) { - val opterrorStateDetails = errorStateDetails.get() - put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) - } + val opterrorStateDetails = errorStateDetails.get() + put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) + } endStructure() } } @@ -57,29 +59,23 @@ class RvcOperationalStateClusterErrorStateStruct( private const val TAG_ERROR_STATE_LABEL = 1 private const val TAG_ERROR_STATE_DETAILS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcOperationalStateClusterErrorStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterErrorStateStruct { tlvReader.enterStructure(tag) val errorStateID = tlvReader.getInt(ContextSpecificTag(TAG_ERROR_STATE_I_D)) - val errorStateLabel = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) - } else { - Optional.empty() - } - val errorStateDetails = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) - } else { - Optional.empty() - } - + val errorStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) + } else { + Optional.empty() + } + val errorStateDetails = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return RvcOperationalStateClusterErrorStateStruct( - errorStateID, - errorStateLabel, - errorStateDetails - ) + return RvcOperationalStateClusterErrorStateStruct(errorStateID, errorStateLabel, errorStateDetails) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt index 66f2796d71439f..0ac8e7e362c07d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt @@ -17,17 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class RvcOperationalStateClusterOperationalStateStruct( - val operationalStateID: Int, - val operationalStateLabel: Optional -) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterOperationalStateStruct ( + val operationalStateID: Int, + val operationalStateLabel: Optional) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterOperationalStateStruct {\n") append("\toperationalStateID : $operationalStateID\n") append("\toperationalStateLabel : $operationalStateLabel\n") @@ -39,9 +41,9 @@ class RvcOperationalStateClusterOperationalStateStruct( startStructure(tag) put(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D), operationalStateID) if (operationalStateLabel.isPresent) { - val optoperationalStateLabel = operationalStateLabel.get() - put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) - } + val optoperationalStateLabel = operationalStateLabel.get() + put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) + } endStructure() } } @@ -50,22 +52,18 @@ class RvcOperationalStateClusterOperationalStateStruct( private const val TAG_OPERATIONAL_STATE_I_D = 0 private const val TAG_OPERATIONAL_STATE_LABEL = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcOperationalStateClusterOperationalStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterOperationalStateStruct { tlvReader.enterStructure(tag) val operationalStateID = tlvReader.getInt(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D)) - val operationalStateLabel = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) - } else { - Optional.empty() - } - + val operationalStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return RvcOperationalStateClusterOperationalStateStruct( - operationalStateID, - operationalStateLabel - ) + return RvcOperationalStateClusterOperationalStateStruct(operationalStateID, operationalStateLabel) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt index 64b272df8e62c2..6c0fa21b62753c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt @@ -20,15 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class RvcRunModeClusterModeOptionStruct( - val label: String, - val mode: Int, - val modeTags: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class RvcRunModeClusterModeOptionStruct ( + val label: String, + val mode: Int, + val modeTags: List) { + override fun toString(): String = buildString { append("RvcRunModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -55,19 +57,18 @@ class RvcRunModeClusterModeOptionStruct( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcRunModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcRunModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while (!tlvReader.isEndOfContainer()) { - add(RvcRunModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while(!tlvReader.isEndOfContainer()) { + add(RvcRunModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return RvcRunModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt index 3ad4e9aee5ba6d..39077679389f9e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt @@ -17,14 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class RvcRunModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { - override fun toString(): String = buildString { +class RvcRunModeClusterModeTagStruct ( + val mfgCode: Optional, + val value: Int) { + override fun toString(): String = buildString { append("RvcRunModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -35,9 +40,9 @@ class RvcRunModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -47,16 +52,15 @@ class RvcRunModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcRunModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcRunModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return RvcRunModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt index 213d87b9137cf5..3376a7d1e849f2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ScenesClusterAttributeValuePair(val attributeID: Long, val attributeValue: Long) { - override fun toString(): String = buildString { +import java.util.Optional + +class ScenesClusterAttributeValuePair ( + val attributeID: Long, + val attributeValue: Long) { + override fun toString(): String = buildString { append("ScenesClusterAttributeValuePair {\n") append("\tattributeID : $attributeID\n") append("\tattributeValue : $attributeValue\n") @@ -43,11 +49,11 @@ class ScenesClusterAttributeValuePair(val attributeID: Long, val attributeValue: private const val TAG_ATTRIBUTE_I_D = 0 private const val TAG_ATTRIBUTE_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ScenesClusterAttributeValuePair { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ScenesClusterAttributeValuePair { tlvReader.enterStructure(tag) val attributeID = tlvReader.getLong(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) val attributeValue = tlvReader.getLong(ContextSpecificTag(TAG_ATTRIBUTE_VALUE)) - + tlvReader.exitContainer() return ScenesClusterAttributeValuePair(attributeID, attributeValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt index edc04a2084e2fd..dde3ec639661d9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt @@ -20,14 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ScenesClusterExtensionFieldSet( - val clusterID: Long, - val attributeValueList: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ScenesClusterExtensionFieldSet ( + val clusterID: Long, + val attributeValueList: List) { + override fun toString(): String = buildString { append("ScenesClusterExtensionFieldSet {\n") append("\tclusterID : $clusterID\n") append("\tattributeValueList : $attributeValueList\n") @@ -51,18 +53,17 @@ class ScenesClusterExtensionFieldSet( private const val TAG_CLUSTER_I_D = 0 private const val TAG_ATTRIBUTE_VALUE_LIST = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ScenesClusterExtensionFieldSet { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ScenesClusterExtensionFieldSet { tlvReader.enterStructure(tag) val clusterID = tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER_I_D)) - val attributeValueList = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ATTRIBUTE_VALUE_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(ScenesClusterAttributeValuePair.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val attributeValueList = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ATTRIBUTE_VALUE_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(ScenesClusterAttributeValuePair.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ScenesClusterExtensionFieldSet(clusterID, attributeValueList) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt index 5359b9a4b70a2a..ae6aa79702b58b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt @@ -17,20 +17,22 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class SoftwareDiagnosticsClusterThreadMetricsStruct( - val id: Long, - val name: Optional, - val stackFreeCurrent: Optional, - val stackFreeMinimum: Optional, - val stackSize: Optional -) { - override fun toString(): String = buildString { +class SoftwareDiagnosticsClusterThreadMetricsStruct ( + val id: Long, + val name: Optional, + val stackFreeCurrent: Optional, + val stackFreeMinimum: Optional, + val stackSize: Optional) { + override fun toString(): String = buildString { append("SoftwareDiagnosticsClusterThreadMetricsStruct {\n") append("\tid : $id\n") append("\tname : $name\n") @@ -45,21 +47,21 @@ class SoftwareDiagnosticsClusterThreadMetricsStruct( startStructure(tag) put(ContextSpecificTag(TAG_ID), id) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } if (stackFreeCurrent.isPresent) { - val optstackFreeCurrent = stackFreeCurrent.get() - put(ContextSpecificTag(TAG_STACK_FREE_CURRENT), optstackFreeCurrent) - } + val optstackFreeCurrent = stackFreeCurrent.get() + put(ContextSpecificTag(TAG_STACK_FREE_CURRENT), optstackFreeCurrent) + } if (stackFreeMinimum.isPresent) { - val optstackFreeMinimum = stackFreeMinimum.get() - put(ContextSpecificTag(TAG_STACK_FREE_MINIMUM), optstackFreeMinimum) - } + val optstackFreeMinimum = stackFreeMinimum.get() + put(ContextSpecificTag(TAG_STACK_FREE_MINIMUM), optstackFreeMinimum) + } if (stackSize.isPresent) { - val optstackSize = stackSize.get() - put(ContextSpecificTag(TAG_STACK_SIZE), optstackSize) - } + val optstackSize = stackSize.get() + put(ContextSpecificTag(TAG_STACK_SIZE), optstackSize) + } endStructure() } } @@ -71,43 +73,33 @@ class SoftwareDiagnosticsClusterThreadMetricsStruct( private const val TAG_STACK_FREE_MINIMUM = 3 private const val TAG_STACK_SIZE = 4 - fun fromTlv(tag: Tag, tlvReader: TlvReader): SoftwareDiagnosticsClusterThreadMetricsStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : SoftwareDiagnosticsClusterThreadMetricsStruct { tlvReader.enterStructure(tag) val id = tlvReader.getLong(ContextSpecificTag(TAG_ID)) - val name = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - val stackFreeCurrent = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) - } else { - Optional.empty() - } - val stackFreeMinimum = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) - } else { - Optional.empty() - } - val stackSize = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_SIZE))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_SIZE))) - } else { - Optional.empty() - } - + val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val stackFreeCurrent = if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) + } else { + Optional.empty() + } + val stackFreeMinimum = if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) + } else { + Optional.empty() + } + val stackSize = if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_SIZE))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_SIZE))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return SoftwareDiagnosticsClusterThreadMetricsStruct( - id, - name, - stackFreeCurrent, - stackFreeMinimum, - stackSize - ) + return SoftwareDiagnosticsClusterThreadMetricsStruct(id, name, stackFreeCurrent, stackFreeMinimum, stackSize) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt index 403134993beaed..475ba3c436fac7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class TargetNavigatorClusterTargetInfoStruct(val identifier: Int, val name: String) { - override fun toString(): String = buildString { +import java.util.Optional + +class TargetNavigatorClusterTargetInfoStruct ( + val identifier: Int, + val name: String) { + override fun toString(): String = buildString { append("TargetNavigatorClusterTargetInfoStruct {\n") append("\tidentifier : $identifier\n") append("\tname : $name\n") @@ -43,11 +49,11 @@ class TargetNavigatorClusterTargetInfoStruct(val identifier: Int, val name: Stri private const val TAG_IDENTIFIER = 0 private const val TAG_NAME = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): TargetNavigatorClusterTargetInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TargetNavigatorClusterTargetInfoStruct { tlvReader.enterStructure(tag) val identifier = tlvReader.getInt(ContextSpecificTag(TAG_IDENTIFIER)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) - + tlvReader.exitContainer() return TargetNavigatorClusterTargetInfoStruct(identifier, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt index cb432fb1e976b4..f63d1bcf959e9e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThermostatClusterThermostatScheduleTransition( - val transitionTime: Int, - val heatSetpoint: Int?, - val coolSetpoint: Int? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThermostatClusterThermostatScheduleTransition ( + val transitionTime: Int, + val heatSetpoint: Int?, + val coolSetpoint: Int?) { + override fun toString(): String = buildString { append("ThermostatClusterThermostatScheduleTransition {\n") append("\ttransitionTime : $transitionTime\n") append("\theatSetpoint : $heatSetpoint\n") @@ -40,15 +43,15 @@ class ThermostatClusterThermostatScheduleTransition( startStructure(tag) put(ContextSpecificTag(TAG_TRANSITION_TIME), transitionTime) if (heatSetpoint != null) { - put(ContextSpecificTag(TAG_HEAT_SETPOINT), heatSetpoint) - } else { - putNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) - } + put(ContextSpecificTag(TAG_HEAT_SETPOINT), heatSetpoint) + } else { + putNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) + } if (coolSetpoint != null) { - put(ContextSpecificTag(TAG_COOL_SETPOINT), coolSetpoint) - } else { - putNull(ContextSpecificTag(TAG_COOL_SETPOINT)) - } + put(ContextSpecificTag(TAG_COOL_SETPOINT), coolSetpoint) + } else { + putNull(ContextSpecificTag(TAG_COOL_SETPOINT)) + } endStructure() } } @@ -58,31 +61,25 @@ class ThermostatClusterThermostatScheduleTransition( private const val TAG_HEAT_SETPOINT = 1 private const val TAG_COOL_SETPOINT = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ThermostatClusterThermostatScheduleTransition { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThermostatClusterThermostatScheduleTransition { tlvReader.enterStructure(tag) val transitionTime = tlvReader.getInt(ContextSpecificTag(TAG_TRANSITION_TIME)) - val heatSetpoint = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_HEAT_SETPOINT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) - null - } - val coolSetpoint = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_COOL_SETPOINT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_COOL_SETPOINT)) - null - } - + val heatSetpoint = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_HEAT_SETPOINT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) + null + } + val coolSetpoint = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_COOL_SETPOINT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_COOL_SETPOINT)) + null + } + tlvReader.exitContainer() - return ThermostatClusterThermostatScheduleTransition( - transitionTime, - heatSetpoint, - coolSetpoint - ) + return ThermostatClusterThermostatScheduleTransition(transitionTime, heatSetpoint, coolSetpoint) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt index 4a7066df5d7f25..5fbc0d517459c1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt @@ -17,28 +17,31 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThreadNetworkDiagnosticsClusterNeighborTableStruct( - val extAddress: Long, - val age: Long, - val rloc16: Int, - val linkFrameCounter: Long, - val mleFrameCounter: Long, - val lqi: Int, - val averageRssi: Int?, - val lastRssi: Int?, - val frameErrorRate: Int, - val messageErrorRate: Int, - val rxOnWhenIdle: Boolean, - val fullThreadDevice: Boolean, - val fullNetworkData: Boolean, - val isChild: Boolean -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThreadNetworkDiagnosticsClusterNeighborTableStruct ( + val extAddress: Long, + val age: Long, + val rloc16: Int, + val linkFrameCounter: Long, + val mleFrameCounter: Long, + val lqi: Int, + val averageRssi: Int?, + val lastRssi: Int?, + val frameErrorRate: Int, + val messageErrorRate: Int, + val rxOnWhenIdle: Boolean, + val fullThreadDevice: Boolean, + val fullNetworkData: Boolean, + val isChild: Boolean) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterNeighborTableStruct {\n") append("\textAddress : $extAddress\n") append("\tage : $age\n") @@ -67,15 +70,15 @@ class ThreadNetworkDiagnosticsClusterNeighborTableStruct( put(ContextSpecificTag(TAG_MLE_FRAME_COUNTER), mleFrameCounter) put(ContextSpecificTag(TAG_LQI), lqi) if (averageRssi != null) { - put(ContextSpecificTag(TAG_AVERAGE_RSSI), averageRssi) - } else { - putNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) - } + put(ContextSpecificTag(TAG_AVERAGE_RSSI), averageRssi) + } else { + putNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) + } if (lastRssi != null) { - put(ContextSpecificTag(TAG_LAST_RSSI), lastRssi) - } else { - putNull(ContextSpecificTag(TAG_LAST_RSSI)) - } + put(ContextSpecificTag(TAG_LAST_RSSI), lastRssi) + } else { + putNull(ContextSpecificTag(TAG_LAST_RSSI)) + } put(ContextSpecificTag(TAG_FRAME_ERROR_RATE), frameErrorRate) put(ContextSpecificTag(TAG_MESSAGE_ERROR_RATE), messageErrorRate) put(ContextSpecificTag(TAG_RX_ON_WHEN_IDLE), rxOnWhenIdle) @@ -102,10 +105,7 @@ class ThreadNetworkDiagnosticsClusterNeighborTableStruct( private const val TAG_FULL_NETWORK_DATA = 12 private const val TAG_IS_CHILD = 13 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): ThreadNetworkDiagnosticsClusterNeighborTableStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterNeighborTableStruct { tlvReader.enterStructure(tag) val extAddress = tlvReader.getLong(ContextSpecificTag(TAG_EXT_ADDRESS)) val age = tlvReader.getLong(ContextSpecificTag(TAG_AGE)) @@ -113,45 +113,28 @@ class ThreadNetworkDiagnosticsClusterNeighborTableStruct( val linkFrameCounter = tlvReader.getLong(ContextSpecificTag(TAG_LINK_FRAME_COUNTER)) val mleFrameCounter = tlvReader.getLong(ContextSpecificTag(TAG_MLE_FRAME_COUNTER)) val lqi = tlvReader.getInt(ContextSpecificTag(TAG_LQI)) - val averageRssi = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_AVERAGE_RSSI)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) - null - } - val lastRssi = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_LAST_RSSI)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LAST_RSSI)) - null - } + val averageRssi = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_AVERAGE_RSSI)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) + null + } + val lastRssi = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_LAST_RSSI)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LAST_RSSI)) + null + } val frameErrorRate = tlvReader.getInt(ContextSpecificTag(TAG_FRAME_ERROR_RATE)) val messageErrorRate = tlvReader.getInt(ContextSpecificTag(TAG_MESSAGE_ERROR_RATE)) val rxOnWhenIdle = tlvReader.getBoolean(ContextSpecificTag(TAG_RX_ON_WHEN_IDLE)) val fullThreadDevice = tlvReader.getBoolean(ContextSpecificTag(TAG_FULL_THREAD_DEVICE)) val fullNetworkData = tlvReader.getBoolean(ContextSpecificTag(TAG_FULL_NETWORK_DATA)) val isChild = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_CHILD)) - + tlvReader.exitContainer() - return ThreadNetworkDiagnosticsClusterNeighborTableStruct( - extAddress, - age, - rloc16, - linkFrameCounter, - mleFrameCounter, - lqi, - averageRssi, - lastRssi, - frameErrorRate, - messageErrorRate, - rxOnWhenIdle, - fullThreadDevice, - fullNetworkData, - isChild - ) + return ThreadNetworkDiagnosticsClusterNeighborTableStruct(extAddress, age, rloc16, linkFrameCounter, mleFrameCounter, lqi, averageRssi, lastRssi, frameErrorRate, messageErrorRate, rxOnWhenIdle, fullThreadDevice, fullNetworkData, isChild) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt index f9764369891073..7276a7f3eccac4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt @@ -17,26 +17,29 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThreadNetworkDiagnosticsClusterOperationalDatasetComponents( - val activeTimestampPresent: Boolean, - val pendingTimestampPresent: Boolean, - val masterKeyPresent: Boolean, - val networkNamePresent: Boolean, - val extendedPanIdPresent: Boolean, - val meshLocalPrefixPresent: Boolean, - val delayPresent: Boolean, - val panIdPresent: Boolean, - val channelPresent: Boolean, - val pskcPresent: Boolean, - val securityPolicyPresent: Boolean, - val channelMaskPresent: Boolean -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThreadNetworkDiagnosticsClusterOperationalDatasetComponents ( + val activeTimestampPresent: Boolean, + val pendingTimestampPresent: Boolean, + val masterKeyPresent: Boolean, + val networkNamePresent: Boolean, + val extendedPanIdPresent: Boolean, + val meshLocalPrefixPresent: Boolean, + val delayPresent: Boolean, + val panIdPresent: Boolean, + val channelPresent: Boolean, + val pskcPresent: Boolean, + val securityPolicyPresent: Boolean, + val channelMaskPresent: Boolean) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterOperationalDatasetComponents {\n") append("\tactiveTimestampPresent : $activeTimestampPresent\n") append("\tpendingTimestampPresent : $pendingTimestampPresent\n") @@ -86,45 +89,24 @@ class ThreadNetworkDiagnosticsClusterOperationalDatasetComponents( private const val TAG_SECURITY_POLICY_PRESENT = 10 private const val TAG_CHANNEL_MASK_PRESENT = 11 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): ThreadNetworkDiagnosticsClusterOperationalDatasetComponents { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterOperationalDatasetComponents { tlvReader.enterStructure(tag) - val activeTimestampPresent = - tlvReader.getBoolean(ContextSpecificTag(TAG_ACTIVE_TIMESTAMP_PRESENT)) - val pendingTimestampPresent = - tlvReader.getBoolean(ContextSpecificTag(TAG_PENDING_TIMESTAMP_PRESENT)) + val activeTimestampPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_ACTIVE_TIMESTAMP_PRESENT)) + val pendingTimestampPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_PENDING_TIMESTAMP_PRESENT)) val masterKeyPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_MASTER_KEY_PRESENT)) val networkNamePresent = tlvReader.getBoolean(ContextSpecificTag(TAG_NETWORK_NAME_PRESENT)) - val extendedPanIdPresent = - tlvReader.getBoolean(ContextSpecificTag(TAG_EXTENDED_PAN_ID_PRESENT)) - val meshLocalPrefixPresent = - tlvReader.getBoolean(ContextSpecificTag(TAG_MESH_LOCAL_PREFIX_PRESENT)) + val extendedPanIdPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_EXTENDED_PAN_ID_PRESENT)) + val meshLocalPrefixPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_MESH_LOCAL_PREFIX_PRESENT)) val delayPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_DELAY_PRESENT)) val panIdPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_PAN_ID_PRESENT)) val channelPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_CHANNEL_PRESENT)) val pskcPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_PSKC_PRESENT)) - val securityPolicyPresent = - tlvReader.getBoolean(ContextSpecificTag(TAG_SECURITY_POLICY_PRESENT)) + val securityPolicyPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_SECURITY_POLICY_PRESENT)) val channelMaskPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_CHANNEL_MASK_PRESENT)) - + tlvReader.exitContainer() - return ThreadNetworkDiagnosticsClusterOperationalDatasetComponents( - activeTimestampPresent, - pendingTimestampPresent, - masterKeyPresent, - networkNamePresent, - extendedPanIdPresent, - meshLocalPrefixPresent, - delayPresent, - panIdPresent, - channelPresent, - pskcPresent, - securityPolicyPresent, - channelMaskPresent - ) + return ThreadNetworkDiagnosticsClusterOperationalDatasetComponents(activeTimestampPresent, pendingTimestampPresent, masterKeyPresent, networkNamePresent, extendedPanIdPresent, meshLocalPrefixPresent, delayPresent, panIdPresent, channelPresent, pskcPresent, securityPolicyPresent, channelMaskPresent) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt index 8a7c423f84e6ad..c204266b42fcf5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt @@ -17,24 +17,27 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThreadNetworkDiagnosticsClusterRouteTableStruct( - val extAddress: Long, - val rloc16: Int, - val routerId: Int, - val nextHop: Int, - val pathCost: Int, - val LQIIn: Int, - val LQIOut: Int, - val age: Int, - val allocated: Boolean, - val linkEstablished: Boolean -) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThreadNetworkDiagnosticsClusterRouteTableStruct ( + val extAddress: Long, + val rloc16: Int, + val routerId: Int, + val nextHop: Int, + val pathCost: Int, + val LQIIn: Int, + val LQIOut: Int, + val age: Int, + val allocated: Boolean, + val linkEstablished: Boolean) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterRouteTableStruct {\n") append("\textAddress : $extAddress\n") append("\trloc16 : $rloc16\n") @@ -78,7 +81,7 @@ class ThreadNetworkDiagnosticsClusterRouteTableStruct( private const val TAG_ALLOCATED = 8 private const val TAG_LINK_ESTABLISHED = 9 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ThreadNetworkDiagnosticsClusterRouteTableStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterRouteTableStruct { tlvReader.enterStructure(tag) val extAddress = tlvReader.getLong(ContextSpecificTag(TAG_EXT_ADDRESS)) val rloc16 = tlvReader.getInt(ContextSpecificTag(TAG_RLOC16)) @@ -90,21 +93,10 @@ class ThreadNetworkDiagnosticsClusterRouteTableStruct( val age = tlvReader.getInt(ContextSpecificTag(TAG_AGE)) val allocated = tlvReader.getBoolean(ContextSpecificTag(TAG_ALLOCATED)) val linkEstablished = tlvReader.getBoolean(ContextSpecificTag(TAG_LINK_ESTABLISHED)) - + tlvReader.exitContainer() - return ThreadNetworkDiagnosticsClusterRouteTableStruct( - extAddress, - rloc16, - routerId, - nextHop, - pathCost, - LQIIn, - LQIOut, - age, - allocated, - linkEstablished - ) + return ThreadNetworkDiagnosticsClusterRouteTableStruct(extAddress, rloc16, routerId, nextHop, pathCost, LQIIn, LQIOut, age, allocated, linkEstablished) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt index 1474db405b9d43..d12f6e24c345f9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class ThreadNetworkDiagnosticsClusterSecurityPolicy(val rotationTime: Int, val flags: Int) { - override fun toString(): String = buildString { +import java.util.Optional + +class ThreadNetworkDiagnosticsClusterSecurityPolicy ( + val rotationTime: Int, + val flags: Int) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterSecurityPolicy {\n") append("\trotationTime : $rotationTime\n") append("\tflags : $flags\n") @@ -43,11 +49,11 @@ class ThreadNetworkDiagnosticsClusterSecurityPolicy(val rotationTime: Int, val f private const val TAG_ROTATION_TIME = 0 private const val TAG_FLAGS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): ThreadNetworkDiagnosticsClusterSecurityPolicy { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterSecurityPolicy { tlvReader.enterStructure(tag) val rotationTime = tlvReader.getInt(ContextSpecificTag(TAG_ROTATION_TIME)) val flags = tlvReader.getInt(ContextSpecificTag(TAG_FLAGS)) - + tlvReader.exitContainer() return ThreadNetworkDiagnosticsClusterSecurityPolicy(rotationTime, flags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt index d770d7a2ac8e03..be643cca35be70 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class TimeSynchronizationClusterDSTOffsetStruct( - val offset: Long, - val validStarting: Long, - val validUntil: Long? -) { - override fun toString(): String = buildString { +import java.util.Optional + +class TimeSynchronizationClusterDSTOffsetStruct ( + val offset: Long, + val validStarting: Long, + val validUntil: Long?) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterDSTOffsetStruct {\n") append("\toffset : $offset\n") append("\tvalidStarting : $validStarting\n") @@ -41,10 +44,10 @@ class TimeSynchronizationClusterDSTOffsetStruct( put(ContextSpecificTag(TAG_OFFSET), offset) put(ContextSpecificTag(TAG_VALID_STARTING), validStarting) if (validUntil != null) { - put(ContextSpecificTag(TAG_VALID_UNTIL), validUntil) - } else { - putNull(ContextSpecificTag(TAG_VALID_UNTIL)) - } + put(ContextSpecificTag(TAG_VALID_UNTIL), validUntil) + } else { + putNull(ContextSpecificTag(TAG_VALID_UNTIL)) + } endStructure() } } @@ -54,18 +57,17 @@ class TimeSynchronizationClusterDSTOffsetStruct( private const val TAG_VALID_STARTING = 1 private const val TAG_VALID_UNTIL = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterDSTOffsetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterDSTOffsetStruct { tlvReader.enterStructure(tag) val offset = tlvReader.getLong(ContextSpecificTag(TAG_OFFSET)) val validStarting = tlvReader.getLong(ContextSpecificTag(TAG_VALID_STARTING)) - val validUntil = - if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_VALID_UNTIL)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_VALID_UNTIL)) - null - } - + val validUntil = if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_VALID_UNTIL)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VALID_UNTIL)) + null + } + tlvReader.exitContainer() return TimeSynchronizationClusterDSTOffsetStruct(offset, validStarting, validUntil) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt index 7a2e95c671517a..8c3acf12fe54e8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt @@ -17,16 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct( - val nodeID: Long, - val endpoint: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct ( + val nodeID: Long, + val endpoint: Int) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct {\n") append("\tnodeID : $nodeID\n") append("\tendpoint : $endpoint\n") @@ -46,14 +49,11 @@ class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct( private const val TAG_NODE_I_D = 0 private const val TAG_ENDPOINT = 1 - fun fromTlv( - tag: Tag, - tlvReader: TlvReader - ): TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct { tlvReader.enterStructure(tag) val nodeID = tlvReader.getLong(ContextSpecificTag(TAG_NODE_I_D)) val endpoint = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) - + tlvReader.exitContainer() return TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct(nodeID, endpoint) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt index 8a256fd7edfefe..11bdbff1851eaf 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt @@ -17,18 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class TimeSynchronizationClusterTimeZoneStruct( - val offset: Long, - val validAt: Long, - val name: Optional -) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterTimeZoneStruct ( + val offset: Long, + val validAt: Long, + val name: Optional) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterTimeZoneStruct {\n") append("\toffset : $offset\n") append("\tvalidAt : $validAt\n") @@ -42,9 +44,9 @@ class TimeSynchronizationClusterTimeZoneStruct( put(ContextSpecificTag(TAG_OFFSET), offset) put(ContextSpecificTag(TAG_VALID_AT), validAt) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } endStructure() } } @@ -54,17 +56,16 @@ class TimeSynchronizationClusterTimeZoneStruct( private const val TAG_VALID_AT = 1 private const val TAG_NAME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterTimeZoneStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterTimeZoneStruct { tlvReader.enterStructure(tag) val offset = tlvReader.getLong(ContextSpecificTag(TAG_OFFSET)) val validAt = tlvReader.getLong(ContextSpecificTag(TAG_VALID_AT)) - val name = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - + val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return TimeSynchronizationClusterTimeZoneStruct(offset, validAt, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt index db50619ad5da53..668f0c1e923143 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class TimeSynchronizationClusterTrustedTimeSourceStruct( - val fabricIndex: Int, - val nodeID: Long, - val endpoint: Int -) { - override fun toString(): String = buildString { +import java.util.Optional + +class TimeSynchronizationClusterTrustedTimeSourceStruct ( + val fabricIndex: Int, + val nodeID: Long, + val endpoint: Int) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterTrustedTimeSourceStruct {\n") append("\tfabricIndex : $fabricIndex\n") append("\tnodeID : $nodeID\n") @@ -50,12 +53,12 @@ class TimeSynchronizationClusterTrustedTimeSourceStruct( private const val TAG_NODE_I_D = 1 private const val TAG_ENDPOINT = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterTrustedTimeSourceStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterTrustedTimeSourceStruct { tlvReader.enterStructure(tag) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) val nodeID = tlvReader.getLong(ContextSpecificTag(TAG_NODE_I_D)) val endpoint = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) - + tlvReader.exitContainer() return TimeSynchronizationClusterTrustedTimeSourceStruct(fabricIndex, nodeID, endpoint) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt index bd34e9f5a90c49..ed3e7a0ef74243 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt @@ -20,11 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterDoubleNestedStructList(val a: List) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterDoubleNestedStructList ( + val a: List) { + override fun toString(): String = buildString { append("UnitTestingClusterDoubleNestedStructList {\n") append("\ta : $a\n") append("}\n") @@ -45,17 +49,16 @@ class UnitTestingClusterDoubleNestedStructList(val a: List { - tlvReader.enterList(ContextSpecificTag(TAG_A)) - while (!tlvReader.isEndOfContainer()) { - add(UnitTestingClusterNestedStructList.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val a = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_A)) + while(!tlvReader.isEndOfContainer()) { + add(UnitTestingClusterNestedStructList.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return UnitTestingClusterDoubleNestedStructList(a) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt index 7ca3b0b29aab01..c0de5e08f6886b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt @@ -17,17 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterNestedStruct( - val a: Int, - val b: Boolean, - val c: UnitTestingClusterSimpleStruct -) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterNestedStruct ( + val a: Int, + val b: Boolean, + val c: UnitTestingClusterSimpleStruct) { + override fun toString(): String = buildString { append("UnitTestingClusterNestedStruct {\n") append("\ta : $a\n") append("\tb : $b\n") @@ -50,12 +53,12 @@ class UnitTestingClusterNestedStruct( private const val TAG_B = 1 private const val TAG_C = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterNestedStruct { tlvReader.enterStructure(tag) val a = tlvReader.getInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader) - + tlvReader.exitContainer() return UnitTestingClusterNestedStruct(a, b, c) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt index b954fe0ec9879b..9b41c3e439e192 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt @@ -20,19 +20,21 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterNestedStructList( - val a: Int, - val b: Boolean, - val c: UnitTestingClusterSimpleStruct, - val d: List, - val e: List, - val f: List, - val g: List -) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterNestedStructList ( + val a: Int, + val b: Boolean, + val c: UnitTestingClusterSimpleStruct, + val d: List, + val e: List, + val f: List, + val g: List) { + override fun toString(): String = buildString { append("UnitTestingClusterNestedStructList {\n") append("\ta : $a\n") append("\tb : $b\n") @@ -83,44 +85,40 @@ class UnitTestingClusterNestedStructList( private const val TAG_F = 5 private const val TAG_G = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStructList { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterNestedStructList { tlvReader.enterStructure(tag) val a = tlvReader.getInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader) - val d = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_D)) - while (!tlvReader.isEndOfContainer()) { - add(UnitTestingClusterSimpleStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - val e = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_E)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getLong(AnonymousTag)) - } - tlvReader.exitContainer() - } - val f = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_F)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getByteArray(AnonymousTag)) - } - tlvReader.exitContainer() - } - val g = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_G)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val d = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_D)) + while(!tlvReader.isEndOfContainer()) { + add(UnitTestingClusterSimpleStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val e = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_E)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getLong(AnonymousTag)) + } + tlvReader.exitContainer() + } + val f = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_F)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getByteArray(AnonymousTag)) + } + tlvReader.exitContainer() + } + val g = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_G)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return UnitTestingClusterNestedStructList(a, b, c, d, e, f, g) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt index 08a4b642e69d45..1533278b6a1fac 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt @@ -20,25 +20,26 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class UnitTestingClusterNullablesAndOptionalsStruct( - val nullableInt: Int?, - val optionalInt: Optional, - val nullableOptionalInt: Optional?, - val nullableString: String?, - val optionalString: Optional, - val nullableOptionalString: Optional?, - val nullableStruct: UnitTestingClusterSimpleStruct?, - val optionalStruct: Optional, - val nullableOptionalStruct: Optional?, - val nullableList: List?, - val optionalList: Optional>, - val nullableOptionalList: Optional>? -) { - override fun toString(): String = buildString { +class UnitTestingClusterNullablesAndOptionalsStruct ( + val nullableInt: Int?, + val optionalInt: Optional, + val nullableOptionalInt: Optional?, + val nullableString: String?, + val optionalString: Optional, + val nullableOptionalString: Optional?, + val nullableStruct: UnitTestingClusterSimpleStruct?, + val optionalStruct: Optional, + val nullableOptionalStruct: Optional?, + val nullableList: List?, + val optionalList: Optional>, + val nullableOptionalList: Optional>?) { + override fun toString(): String = buildString { append("UnitTestingClusterNullablesAndOptionalsStruct {\n") append("\tnullableInt : $nullableInt\n") append("\toptionalInt : $optionalInt\n") @@ -59,85 +60,85 @@ class UnitTestingClusterNullablesAndOptionalsStruct( tlvWriter.apply { startStructure(tag) if (nullableInt != null) { - put(ContextSpecificTag(TAG_NULLABLE_INT), nullableInt) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_INT)) - } + put(ContextSpecificTag(TAG_NULLABLE_INT), nullableInt) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_INT)) + } if (optionalInt.isPresent) { - val optoptionalInt = optionalInt.get() - put(ContextSpecificTag(TAG_OPTIONAL_INT), optoptionalInt) - } + val optoptionalInt = optionalInt.get() + put(ContextSpecificTag(TAG_OPTIONAL_INT), optoptionalInt) + } if (nullableOptionalInt != null) { - if (nullableOptionalInt.isPresent) { - val optnullableOptionalInt = nullableOptionalInt.get() - put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT), optnullableOptionalInt) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) - } + if (nullableOptionalInt.isPresent) { + val optnullableOptionalInt = nullableOptionalInt.get() + put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT), optnullableOptionalInt) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) + } if (nullableString != null) { - put(ContextSpecificTag(TAG_NULLABLE_STRING), nullableString) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_STRING)) - } + put(ContextSpecificTag(TAG_NULLABLE_STRING), nullableString) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_STRING)) + } if (optionalString.isPresent) { - val optoptionalString = optionalString.get() - put(ContextSpecificTag(TAG_OPTIONAL_STRING), optoptionalString) - } + val optoptionalString = optionalString.get() + put(ContextSpecificTag(TAG_OPTIONAL_STRING), optoptionalString) + } if (nullableOptionalString != null) { - if (nullableOptionalString.isPresent) { - val optnullableOptionalString = nullableOptionalString.get() - put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING), optnullableOptionalString) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) - } + if (nullableOptionalString.isPresent) { + val optnullableOptionalString = nullableOptionalString.get() + put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING), optnullableOptionalString) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) + } if (nullableStruct != null) { - nullableStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), this) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) - } + nullableStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), this) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) + } if (optionalStruct.isPresent) { - val optoptionalStruct = optionalStruct.get() - optoptionalStruct.toTlv(ContextSpecificTag(TAG_OPTIONAL_STRUCT), this) - } + val optoptionalStruct = optionalStruct.get() + optoptionalStruct.toTlv(ContextSpecificTag(TAG_OPTIONAL_STRUCT), this) + } if (nullableOptionalStruct != null) { - if (nullableOptionalStruct.isPresent) { - val optnullableOptionalStruct = nullableOptionalStruct.get() - optnullableOptionalStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), this) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) - } + if (nullableOptionalStruct.isPresent) { + val optnullableOptionalStruct = nullableOptionalStruct.get() + optnullableOptionalStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), this) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) + } if (nullableList != null) { - startList(ContextSpecificTag(TAG_NULLABLE_LIST)) - for (item in nullableList.iterator()) { - put(AnonymousTag, item) - } - endList() - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_LIST)) + startList(ContextSpecificTag(TAG_NULLABLE_LIST)) + for (item in nullableList.iterator()) { + put(AnonymousTag, item) } + endList() + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_LIST)) + } if (optionalList.isPresent) { - val optoptionalList = optionalList.get() - startList(ContextSpecificTag(TAG_OPTIONAL_LIST)) - for (item in optoptionalList.iterator()) { - put(AnonymousTag, item) - } - endList() + val optoptionalList = optionalList.get() + startList(ContextSpecificTag(TAG_OPTIONAL_LIST)) + for (item in optoptionalList.iterator()) { + put(AnonymousTag, item) } + endList() + } if (nullableOptionalList != null) { - if (nullableOptionalList.isPresent) { - val optnullableOptionalList = nullableOptionalList.get() - startList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - for (item in optnullableOptionalList.iterator()) { - put(AnonymousTag, item) - } - endList() - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + if (nullableOptionalList.isPresent) { + val optnullableOptionalList = nullableOptionalList.get() + startList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + for (item in optnullableOptionalList.iterator()) { + put(AnonymousTag, item) } + endList() + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + } endStructure() } } @@ -156,153 +157,114 @@ class UnitTestingClusterNullablesAndOptionalsStruct( private const val TAG_OPTIONAL_LIST = 10 private const val TAG_NULLABLE_OPTIONAL_LIST = 11 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterNullablesAndOptionalsStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterNullablesAndOptionalsStruct { tlvReader.enterStructure(tag) - val nullableInt = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_INT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_INT)) - null - } - val optionalInt = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_INT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_INT))) - } else { - Optional.empty() - } - val nullableOptionalInt = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) - null - } - val nullableString = - if (!tlvReader.isNull()) { - tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_STRING)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRING)) - null - } - val optionalString = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRING))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPTIONAL_STRING))) - } else { - Optional.empty() - } - val nullableOptionalString = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) - null - } - val nullableStruct = - if (!tlvReader.isNull()) { - UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), tlvReader) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) - null - } - val optionalStruct = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRUCT))) { - Optional.of( - UnitTestingClusterSimpleStruct.fromTlv( - ContextSpecificTag(TAG_OPTIONAL_STRUCT), - tlvReader - ) - ) - } else { - Optional.empty() - } - val nullableOptionalStruct = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT))) { - Optional.of( - UnitTestingClusterSimpleStruct.fromTlv( - ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), - tlvReader - ) - ) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) - null - } - val nullableList = - if (!tlvReader.isNull()) { - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_LIST)) - null - } - val optionalList = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_LIST))) { - Optional.of( - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_OPTIONAL_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() - } - val nullableOptionalList = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST))) { - Optional.of( - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - ) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - null - } - + val nullableInt = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_INT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_INT)) + null + } + val optionalInt = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_INT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_INT))) + } else { + Optional.empty() + } + val nullableOptionalInt = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) + null + } + val nullableString = if (!tlvReader.isNull()) { + tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_STRING)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRING)) + null + } + val optionalString = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRING))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPTIONAL_STRING))) + } else { + Optional.empty() + } + val nullableOptionalString = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) + null + } + val nullableStruct = if (!tlvReader.isNull()) { + UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), tlvReader) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) + null + } + val optionalStruct = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRUCT))) { + Optional.of(UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_OPTIONAL_STRUCT), tlvReader)) + } else { + Optional.empty() + } + val nullableOptionalStruct = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT))) { + Optional.of(UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), tlvReader)) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) + null + } + val nullableList = if (!tlvReader.isNull()) { + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_LIST)) + null + } + val optionalList = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_LIST))) { + Optional.of(buildList { + tlvReader.enterList(ContextSpecificTag(TAG_OPTIONAL_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + }) + } else { + Optional.empty() + } + val nullableOptionalList = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST))) { + Optional.of(buildList { + tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + }) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + null + } + tlvReader.exitContainer() - return UnitTestingClusterNullablesAndOptionalsStruct( - nullableInt, - optionalInt, - nullableOptionalInt, - nullableString, - optionalString, - nullableOptionalString, - nullableStruct, - optionalStruct, - nullableOptionalStruct, - nullableList, - optionalList, - nullableOptionalList - ) + return UnitTestingClusterNullablesAndOptionalsStruct(nullableInt, optionalInt, nullableOptionalInt, nullableString, optionalString, nullableOptionalString, nullableStruct, optionalStruct, nullableOptionalStruct, nullableList, optionalList, nullableOptionalList) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt index 26bf18a07ed214..381016bd583fa5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt @@ -17,22 +17,25 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterSimpleStruct( - val a: Int, - val b: Boolean, - val c: Int, - val d: ByteArray, - val e: String, - val f: Int, - val g: Float, - val h: Double -) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterSimpleStruct ( + val a: Int, + val b: Boolean, + val c: Int, + val d: ByteArray, + val e: String, + val f: Int, + val g: Float, + val h: Double) { + override fun toString(): String = buildString { append("UnitTestingClusterSimpleStruct {\n") append("\ta : $a\n") append("\tb : $b\n") @@ -70,7 +73,7 @@ class UnitTestingClusterSimpleStruct( private const val TAG_G = 6 private const val TAG_H = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterSimpleStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterSimpleStruct { tlvReader.enterStructure(tag) val a = tlvReader.getInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) @@ -80,7 +83,7 @@ class UnitTestingClusterSimpleStruct( val f = tlvReader.getInt(ContextSpecificTag(TAG_F)) val g = tlvReader.getFloat(ContextSpecificTag(TAG_G)) val h = tlvReader.getDouble(ContextSpecificTag(TAG_H)) - + tlvReader.exitContainer() return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt index 6b7273f3172d5d..8a7b42ba939ae6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt @@ -20,21 +20,22 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter + import java.util.Optional -class UnitTestingClusterTestFabricScoped( - val fabricSensitiveInt8u: Int, - val optionalFabricSensitiveInt8u: Optional, - val nullableFabricSensitiveInt8u: Int?, - val nullableOptionalFabricSensitiveInt8u: Optional?, - val fabricSensitiveCharString: String, - val fabricSensitiveStruct: UnitTestingClusterSimpleStruct, - val fabricSensitiveInt8uList: List, - val fabricIndex: Int -) { - override fun toString(): String = buildString { +class UnitTestingClusterTestFabricScoped ( + val fabricSensitiveInt8u: Int, + val optionalFabricSensitiveInt8u: Optional, + val nullableFabricSensitiveInt8u: Int?, + val nullableOptionalFabricSensitiveInt8u: Optional?, + val fabricSensitiveCharString: String, + val fabricSensitiveStruct: UnitTestingClusterSimpleStruct, + val fabricSensitiveInt8uList: List, + val fabricIndex: Int) { + override fun toString(): String = buildString { append("UnitTestingClusterTestFabricScoped {\n") append("\tfabricSensitiveInt8u : $fabricSensitiveInt8u\n") append("\toptionalFabricSensitiveInt8u : $optionalFabricSensitiveInt8u\n") @@ -52,28 +53,22 @@ class UnitTestingClusterTestFabricScoped( startStructure(tag) put(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U), fabricSensitiveInt8u) if (optionalFabricSensitiveInt8u.isPresent) { - val optoptionalFabricSensitiveInt8u = optionalFabricSensitiveInt8u.get() - put( - ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U), - optoptionalFabricSensitiveInt8u - ) - } + val optoptionalFabricSensitiveInt8u = optionalFabricSensitiveInt8u.get() + put(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U), optoptionalFabricSensitiveInt8u) + } if (nullableFabricSensitiveInt8u != null) { - put(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U), nullableFabricSensitiveInt8u) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) - } + put(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U), nullableFabricSensitiveInt8u) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) + } if (nullableOptionalFabricSensitiveInt8u != null) { - if (nullableOptionalFabricSensitiveInt8u.isPresent) { - val optnullableOptionalFabricSensitiveInt8u = nullableOptionalFabricSensitiveInt8u.get() - put( - ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U), - optnullableOptionalFabricSensitiveInt8u - ) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) - } + if (nullableOptionalFabricSensitiveInt8u.isPresent) { + val optnullableOptionalFabricSensitiveInt8u = nullableOptionalFabricSensitiveInt8u.get() + put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U), optnullableOptionalFabricSensitiveInt8u) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) + } put(ContextSpecificTag(TAG_FABRIC_SENSITIVE_CHAR_STRING), fabricSensitiveCharString) fabricSensitiveStruct.toTlv(ContextSpecificTag(TAG_FABRIC_SENSITIVE_STRUCT), this) startList(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U_LIST)) @@ -96,66 +91,44 @@ class UnitTestingClusterTestFabricScoped( private const val TAG_FABRIC_SENSITIVE_INT8U_LIST = 7 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestFabricScoped { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestFabricScoped { tlvReader.enterStructure(tag) val fabricSensitiveInt8u = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U)) - val optionalFabricSensitiveInt8u = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) - } else { - Optional.empty() - } - val nullableFabricSensitiveInt8u = - if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) - null - } - val nullableOptionalFabricSensitiveInt8u = - if (!tlvReader.isNull()) { - if ( - tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) - ) { - Optional.of( - tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) - ) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) - null - } - val fabricSensitiveCharString = - tlvReader.getString(ContextSpecificTag(TAG_FABRIC_SENSITIVE_CHAR_STRING)) - val fabricSensitiveStruct = - UnitTestingClusterSimpleStruct.fromTlv( - ContextSpecificTag(TAG_FABRIC_SENSITIVE_STRUCT), - tlvReader - ) - val fabricSensitiveInt8uList = - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U_LIST)) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } + val optionalFabricSensitiveInt8u = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) + } else { + Optional.empty() + } + val nullableFabricSensitiveInt8u = if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) + null + } + val nullableOptionalFabricSensitiveInt8u = if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) + null + } + val fabricSensitiveCharString = tlvReader.getString(ContextSpecificTag(TAG_FABRIC_SENSITIVE_CHAR_STRING)) + val fabricSensitiveStruct = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_FABRIC_SENSITIVE_STRUCT), tlvReader) + val fabricSensitiveInt8uList = buildList { + tlvReader.enterList(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U_LIST)) + while(!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return UnitTestingClusterTestFabricScoped( - fabricSensitiveInt8u, - optionalFabricSensitiveInt8u, - nullableFabricSensitiveInt8u, - nullableOptionalFabricSensitiveInt8u, - fabricSensitiveCharString, - fabricSensitiveStruct, - fabricSensitiveInt8uList, - fabricIndex - ) + return UnitTestingClusterTestFabricScoped(fabricSensitiveInt8u, optionalFabricSensitiveInt8u, nullableFabricSensitiveInt8u, nullableOptionalFabricSensitiveInt8u, fabricSensitiveCharString, fabricSensitiveStruct, fabricSensitiveInt8uList, fabricIndex) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt index 6c5df4cb224166..0540f4f11a30cb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UnitTestingClusterTestListStructOctet(val member1: Long, val member2: ByteArray) { - override fun toString(): String = buildString { +import java.util.Optional + +class UnitTestingClusterTestListStructOctet ( + val member1: Long, + val member2: ByteArray) { + override fun toString(): String = buildString { append("UnitTestingClusterTestListStructOctet {\n") append("\tmember1 : $member1\n") append("\tmember2 : $member2\n") @@ -43,11 +49,11 @@ class UnitTestingClusterTestListStructOctet(val member1: Long, val member2: Byte private const val TAG_MEMBER1 = 0 private const val TAG_MEMBER2 = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestListStructOctet { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestListStructOctet { tlvReader.enterStructure(tag) val member1 = tlvReader.getLong(ContextSpecificTag(TAG_MEMBER1)) val member2 = tlvReader.getByteArray(ContextSpecificTag(TAG_MEMBER2)) - + tlvReader.exitContainer() return UnitTestingClusterTestListStructOctet(member1, member2) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt index d90396f2a010ea..44a824f2303a2e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt @@ -17,13 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag +import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -class UserLabelClusterLabelStruct(val label: String, val value: String) { - override fun toString(): String = buildString { +import java.util.Optional + +class UserLabelClusterLabelStruct ( + val label: String, + val value: String) { + override fun toString(): String = buildString { append("UserLabelClusterLabelStruct {\n") append("\tlabel : $label\n") append("\tvalue : $value\n") @@ -43,11 +49,11 @@ class UserLabelClusterLabelStruct(val label: String, val value: String) { private const val TAG_LABEL = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader): UserLabelClusterLabelStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader) : UserLabelClusterLabelStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return UserLabelClusterLabelStruct(label, value) From d928f3c9b0d63527813707884a24adad4b86d9b1 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Fri, 11 Aug 2023 16:35:26 -0700 Subject: [PATCH 04/10] Revert "Adding laundry washer controls to all clusters" (#28670) --- .../all-clusters-app.matter | 39 -- .../all-clusters-common/all-clusters-app.zap | 332 +------------- .../esp32/main/CMakeLists.txt | 1 - ...olClusterAccessControlEntryChangedEvent.kt | 99 +++-- ...usterAccessControlExtensionChangedEvent.kt | 99 +++-- .../ActionsClusterActionFailedEvent.kt | 21 +- .../ActionsClusterStateChangedEvent.kt | 15 +- .../BasicInformationClusterLeaveEvent.kt | 13 +- ...InformationClusterReachableChangedEvent.kt | 13 +- .../BasicInformationClusterStartUpEvent.kt | 13 +- .../BooleanStateClusterStateChangeEvent.kt | 13 +- ...InformationClusterReachableChangedEvent.kt | 16 +- ...viceBasicInformationClusterStartUpEvent.kt | 13 +- .../DishwasherAlarmClusterNotifyEvent.kt | 21 +- .../DoorLockClusterDoorLockAlarmEvent.kt | 13 +- .../DoorLockClusterDoorStateChangeEvent.kt | 13 +- .../DoorLockClusterLockOperationErrorEvent.kt | 159 ++++--- .../DoorLockClusterLockOperationEvent.kt | 156 ++++--- .../DoorLockClusterLockUserChangeEvent.kt | 121 +++--- ...eneralDiagnosticsClusterBootReasonEvent.kt | 13 +- ...gnosticsClusterHardwareFaultChangeEvent.kt | 46 +- ...agnosticsClusterNetworkFaultChangeEvent.kt | 46 +- ...DiagnosticsClusterRadioFaultChangeEvent.kt | 46 +- ...nalStateClusterOperationCompletionEvent.kt | 94 ++-- ...tionalStateClusterOperationalErrorEvent.kt | 21 +- ...pdateRequestorClusterDownloadErrorEvent.kt | 73 ++-- ...ateRequestorClusterStateTransitionEvent.kt | 52 ++- ...dateRequestorClusterVersionAppliedEvent.kt | 20 +- ...rSourceClusterBatChargeFaultChangeEvent.kt | 43 +- .../PowerSourceClusterBatFaultChangeEvent.kt | 43 +- ...PowerSourceClusterWiredFaultChangeEvent.kt | 43 +- .../RefrigeratorAlarmClusterNotifyEvent.kt | 21 +- ...nalStateClusterOperationCompletionEvent.kt | 97 +++-- ...tionalStateClusterOperationalErrorEvent.kt | 21 +- .../SmokeCoAlarmClusterCOAlarmEvent.kt | 13 +- ...eCoAlarmClusterInterconnectCOAlarmEvent.kt | 13 +- ...AlarmClusterInterconnectSmokeAlarmEvent.kt | 13 +- .../SmokeCoAlarmClusterLowBatteryEvent.kt | 13 +- .../SmokeCoAlarmClusterSmokeAlarmEvent.kt | 13 +- ...areDiagnosticsClusterSoftwareFaultEvent.kt | 52 +-- .../SwitchClusterInitialPressEvent.kt | 13 +- .../SwitchClusterLongPressEvent.kt | 13 +- .../SwitchClusterLongReleaseEvent.kt | 13 +- .../SwitchClusterMultiPressCompleteEvent.kt | 20 +- .../SwitchClusterMultiPressOngoingEvent.kt | 20 +- .../SwitchClusterShortReleaseEvent.kt | 13 +- .../SwitchClusterSwitchLatchedEvent.kt | 13 +- ...DiagnosticsClusterConnectionStatusEvent.kt | 16 +- ...agnosticsClusterNetworkFaultChangeEvent.kt | 49 ++- ...imeSynchronizationClusterDSTStatusEvent.kt | 13 +- ...nchronizationClusterTimeZoneStatusEvent.kt | 30 +- .../UnitTestingClusterTestEventEvent.kt | 65 +-- ...estingClusterTestFabricScopedEventEvent.kt | 13 +- ...agnosticsClusterAssociationFailureEvent.kt | 20 +- ...DiagnosticsClusterConnectionStatusEvent.kt | 16 +- ...orkDiagnosticsClusterDisconnectionEvent.kt | 13 +- ...sControlClusterAccessControlEntryStruct.kt | 108 ++--- ...trolClusterAccessControlExtensionStruct.kt | 14 +- ...ControlClusterAccessControlTargetStruct.kt | 82 ++-- .../structs/ActionsClusterActionStruct.kt | 34 +- .../ActionsClusterEndpointListStruct.kt | 35 +- ...nitoringClusterReplacementProductStruct.kt | 28 +- ...pplicationBasicClusterApplicationStruct.kt | 17 +- ...ationLauncherClusterApplicationEPStruct.kt | 39 +- ...icationLauncherClusterApplicationStruct.kt | 17 +- .../AudioOutputClusterOutputInfoStruct.kt | 15 +- ...nformationClusterCapabilityMinimaStruct.kt | 25 +- ...formationClusterProductAppearanceStruct.kt | 35 +- .../structs/BindingClusterTargetStruct.kt | 90 ++-- ...formationClusterProductAppearanceStruct.kt | 41 +- .../ChannelClusterChannelInfoStruct.kt | 81 ++-- .../structs/ChannelClusterLineupInfoStruct.kt | 54 +-- ...tentLauncherClusterAdditionalInfoStruct.kt | 14 +- ...auncherClusterBrandingInformationStruct.kt | 143 +++--- ...ntentLauncherClusterContentSearchStruct.kt | 29 +- .../ContentLauncherClusterDimensionStruct.kt | 19 +- .../ContentLauncherClusterParameterStruct.kt | 54 +-- ...ntLauncherClusterStyleInformationStruct.kt | 71 +-- .../DescriptorClusterDeviceTypeStruct.kt | 14 +- .../DescriptorClusterSemanticTagStruct.kt | 76 ++-- .../DishwasherModeClusterModeOptionStruct.kt | 33 +- .../DishwasherModeClusterModeTagStruct.kt | 30 +- .../DoorLockClusterCredentialStruct.kt | 14 +- .../structs/FixedLabelClusterLabelStruct.kt | 14 +- ...missioningClusterBasicCommissioningInfo.kt | 28 +- ...neralDiagnosticsClusterNetworkInterface.kt | 117 ++--- ...pKeyManagementClusterGroupInfoMapStruct.kt | 51 +-- ...upKeyManagementClusterGroupKeyMapStruct.kt | 19 +- ...upKeyManagementClusterGroupKeySetStruct.kt | 169 ++++---- ...nitoringClusterReplacementProductStruct.kt | 28 +- ...mentClusterMonitoringRegistrationStruct.kt | 28 +- ...aundryWasherModeClusterModeOptionStruct.kt | 33 +- .../LaundryWasherModeClusterModeTagStruct.kt | 30 +- .../MediaInputClusterInputInfoStruct.kt | 21 +- ...iaPlaybackClusterPlaybackPositionStruct.kt | 35 +- .../ModeSelectClusterModeOptionStruct.kt | 33 +- .../ModeSelectClusterSemanticTagStruct.kt | 14 +- ...rkCommissioningClusterNetworkInfoStruct.kt | 17 +- ...gClusterThreadInterfaceScanResultStruct.kt | 43 +- ...ingClusterWiFiInterfaceScanResultStruct.kt | 37 +- ...redentialsClusterFabricDescriptorStruct.kt | 37 +- .../OperationalCredentialsClusterNOCStruct.kt | 40 +- ...OperationalStateClusterErrorStateStruct.kt | 58 +-- ...ionalStateClusterOperationalStateStruct.kt | 38 +- ...eUpdateRequestorClusterProviderLocation.kt | 25 +- ...erSourceClusterBatChargeFaultChangeType.kt | 43 +- .../PowerSourceClusterBatFaultChangeType.kt | 43 +- .../PowerSourceClusterWiredFaultChangeType.kt | 43 +- ...olledCabinetModeClusterModeOptionStruct.kt | 47 +- ...ntrolledCabinetModeClusterModeTagStruct.kt | 36 +- .../RvcCleanModeClusterModeOptionStruct.kt | 33 +- .../RvcCleanModeClusterModeTagStruct.kt | 30 +- ...OperationalStateClusterErrorStateStruct.kt | 58 +-- ...ionalStateClusterOperationalStateStruct.kt | 38 +- .../RvcRunModeClusterModeOptionStruct.kt | 33 +- .../structs/RvcRunModeClusterModeTagStruct.kt | 30 +- .../ScenesClusterAttributeValuePair.kt | 14 +- .../structs/ScenesClusterExtensionFieldSet.kt | 31 +- ...reDiagnosticsClusterThreadMetricsStruct.kt | 98 +++-- .../TargetNavigatorClusterTargetInfoStruct.kt | 14 +- ...statClusterThermostatScheduleTransition.kt | 67 +-- ...rkDiagnosticsClusterNeighborTableStruct.kt | 103 +++-- ...ticsClusterOperationalDatasetComponents.kt | 70 +-- ...tworkDiagnosticsClusterRouteTableStruct.kt | 46 +- ...NetworkDiagnosticsClusterSecurityPolicy.kt | 14 +- ...meSynchronizationClusterDSTOffsetStruct.kt | 40 +- ...sterFabricScopedTrustedTimeSourceStruct.kt | 20 +- ...imeSynchronizationClusterTimeZoneStruct.kt | 35 +- ...onizationClusterTrustedTimeSourceStruct.kt | 19 +- ...nitTestingClusterDoubleNestedStructList.kt | 27 +- .../structs/UnitTestingClusterNestedStruct.kt | 19 +- .../UnitTestingClusterNestedStructList.kt | 86 ++-- ...stingClusterNullablesAndOptionalsStruct.kt | 410 ++++++++++-------- .../structs/UnitTestingClusterSimpleStruct.kt | 29 +- .../UnitTestingClusterTestFabricScoped.kt | 145 ++++--- .../UnitTestingClusterTestListStructOctet.kt | 14 +- .../structs/UserLabelClusterLabelStruct.kt | 14 +- 137 files changed, 2961 insertions(+), 3221 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index d3593cf9564395..4510215cc4fa80 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2589,32 +2589,6 @@ server cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } -/** This cluster supports remotely monitoring and controling the different typs of functionality available to a washing device, such as a washing machine. */ -server cluster LaundryWasherControls = 83 { - enum NumberOfRinsesEnum : ENUM8 { - kNone = 0; - kNormal = 1; - kExtra = 2; - kMax = 3; - } - - bitmap Feature : BITMAP32 { - kSpin = 0x1; - kRinse = 0x2; - } - - readonly attribute CHAR_STRING spinSpeeds[] = 0; - attribute nullable int8u spinSpeedCurrent = 1; - attribute NumberOfRinsesEnum numberOfRinses = 2; - readonly attribute NumberOfRinsesEnum supportedRinses[] = 3; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster RvcRunMode = 84 { enum ModeTag : ENUM16 { @@ -6647,19 +6621,6 @@ endpoint 1 { ram attribute clusterRevision default = 1; } - server cluster LaundryWasherControls { - callback attribute spinSpeeds; - ram attribute spinSpeedCurrent; - ram attribute numberOfRinses; - callback attribute supportedRinses; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 3; - ram attribute clusterRevision default = 1; - } - server cluster RvcRunMode { callback attribute supportedModes; callback attribute currentMode; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index c3580af95b8741..f7983bd036f737 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -33,33 +33,7 @@ ], "endpointTypes": [ { - "id": 13, "name": "MA-rootdevice", - "deviceTypeRef": { - "id": 177, - "code": 22, - "profileId": 259, - "label": "MA-rootdevice", - "name": "MA-rootdevice" - }, - "deviceTypes": [ - { - "id": 177, - "code": 22, - "profileId": 259, - "label": "MA-rootdevice", - "name": "MA-rootdevice" - } - ], - "deviceTypeRefs": [ - 177 - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 22 - ], "deviceTypeName": "MA-rootdevice", "deviceTypeCode": 22, "deviceTypeProfileId": 259, @@ -9506,33 +9480,7 @@ ] }, { - "id": 16, "name": "MA-onofflight", - "deviceTypeRef": { - "id": 183, - "code": 256, - "profileId": 259, - "label": "MA-onofflight", - "name": "MA-onofflight" - }, - "deviceTypes": [ - { - "id": 183, - "code": 256, - "profileId": 259, - "label": "MA-onofflight", - "name": "MA-onofflight" - } - ], - "deviceTypeRefs": [ - 183 - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 256 - ], "deviceTypeName": "MA-onofflight", "deviceTypeCode": 256, "deviceTypeProfileId": 259, @@ -14069,218 +14017,6 @@ } ] }, - { - "name": "Laundry Washer Controls", - "code": 83, - "mfgCode": null, - "define": "LAUNDRY_WASHER_CONTROLS_CLUSTER", - "side": "client", - "enabled": 0, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Laundry Washer Controls", - "code": 83, - "mfgCode": null, - "define": "LAUNDRY_WASHER_CONTROLS_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "SpinSpeeds", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SpinSpeedCurrent", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "NumberOfRinses", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "NumberOfRinsesEnum", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SupportedRinses", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "GeneratedCommandList", - "code": 65528, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AcceptedCommandList", - "code": 65529, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "EventList", - "code": 65530, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "AttributeList", - "code": 65531, - "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "RVC Run Mode", "code": 84, @@ -29197,33 +28933,7 @@ ] }, { - "id": 15, "name": "MA-onofflight", - "deviceTypeRef": { - "id": 183, - "code": 256, - "profileId": 259, - "label": "MA-onofflight", - "name": "MA-onofflight" - }, - "deviceTypes": [ - { - "id": 183, - "code": 256, - "profileId": 259, - "label": "MA-onofflight", - "name": "MA-onofflight" - } - ], - "deviceTypeRefs": [ - 183 - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 256 - ], "deviceTypeName": "MA-onofflight", "deviceTypeCode": 256, "deviceTypeProfileId": 259, @@ -32829,33 +32539,7 @@ ] }, { - "id": 14, "name": "Anonymous Endpoint Type", - "deviceTypeRef": { - "id": 228, - "code": 61442, - "profileId": 259, - "label": "MA-secondary-network-commissioning", - "name": "MA-secondary-network-commissioning" - }, - "deviceTypes": [ - { - "id": 228, - "code": 61442, - "profileId": 259, - "label": "MA-secondary-network-commissioning", - "name": "MA-secondary-network-commissioning" - } - ], - "deviceTypeRefs": [ - 228 - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 61442 - ], "deviceTypeName": "MA-secondary-network-commissioning", "deviceTypeCode": 61442, "deviceTypeProfileId": 259, @@ -33337,28 +33021,36 @@ "endpointTypeIndex": 0, "profileId": 259, "endpointId": 0, - "networkId": 0 + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 22 }, { "endpointTypeName": "MA-onofflight", "endpointTypeIndex": 1, "profileId": 259, "endpointId": 1, - "networkId": 0 + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 256 }, { "endpointTypeName": "MA-onofflight", "endpointTypeIndex": 2, "profileId": 259, "endpointId": 2, - "networkId": 0 + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 256 }, { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 3, "profileId": 259, "endpointId": 65534, - "networkId": 0 + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 61442 } ], "log": [] diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index caacc1c5b2acfb..b5435325459417 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -96,7 +96,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/dishwasher-alarm-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/laundry-washer-controls-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" ) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt index 338c93d265e2c2..e926e70d861c20 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlEntryChangedEvent.kt @@ -17,22 +17,20 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class AccessControlClusterAccessControlEntryChangedEvent ( - val adminNodeID: Long?, - val adminPasscodeID: Int?, - val changeType: Int, - val latestValue: chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct?, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class AccessControlClusterAccessControlEntryChangedEvent( + val adminNodeID: Long?, + val adminPasscodeID: Int?, + val changeType: Int, + val latestValue: + chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct?, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlEntryChangedEvent {\n") append("\tadminNodeID : $adminNodeID\n") append("\tadminPasscodeID : $adminPasscodeID\n") @@ -46,21 +44,21 @@ class AccessControlClusterAccessControlEntryChangedEvent ( tlvWriter.apply { startStructure(tag) if (adminNodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } if (adminPasscodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } put(ContextSpecificTag(TAG_CHANGE_TYPE), changeType) if (latestValue != null) { - latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) - } else { - putNull(ContextSpecificTag(TAG_LATEST_VALUE)) - } + latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) + } else { + putNull(ContextSpecificTag(TAG_LATEST_VALUE)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -73,32 +71,45 @@ class AccessControlClusterAccessControlEntryChangedEvent ( private const val TAG_LATEST_VALUE = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlEntryChangedEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): AccessControlClusterAccessControlEntryChangedEvent { tlvReader.enterStructure(tag) - val adminNodeID = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - null - } - val adminPasscodeID = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - null - } + val adminNodeID = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + null + } + val adminPasscodeID = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + null + } val changeType = tlvReader.getInt(ContextSpecificTag(TAG_CHANGE_TYPE)) - val latestValue = if (!tlvReader.isNull()) { - chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) - null - } + val latestValue = + if (!tlvReader.isNull()) { + chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlEntryStruct + .fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return AccessControlClusterAccessControlEntryChangedEvent(adminNodeID, adminPasscodeID, changeType, latestValue, fabricIndex) + return AccessControlClusterAccessControlEntryChangedEvent( + adminNodeID, + adminPasscodeID, + changeType, + latestValue, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt index 064b86812956d4..e01b81cec705bb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AccessControlClusterAccessControlExtensionChangedEvent.kt @@ -17,22 +17,20 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class AccessControlClusterAccessControlExtensionChangedEvent ( - val adminNodeID: Long?, - val adminPasscodeID: Int?, - val changeType: Int, - val latestValue: chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct?, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class AccessControlClusterAccessControlExtensionChangedEvent( + val adminNodeID: Long?, + val adminPasscodeID: Int?, + val changeType: Int, + val latestValue: + chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct?, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlExtensionChangedEvent {\n") append("\tadminNodeID : $adminNodeID\n") append("\tadminPasscodeID : $adminPasscodeID\n") @@ -46,21 +44,21 @@ class AccessControlClusterAccessControlExtensionChangedEvent ( tlvWriter.apply { startStructure(tag) if (adminNodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_NODE_I_D), adminNodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } if (adminPasscodeID != null) { - put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) - } else { - putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } + put(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D), adminPasscodeID) + } else { + putNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } put(ContextSpecificTag(TAG_CHANGE_TYPE), changeType) if (latestValue != null) { - latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) - } else { - putNull(ContextSpecificTag(TAG_LATEST_VALUE)) - } + latestValue.toTlv(ContextSpecificTag(TAG_LATEST_VALUE), this) + } else { + putNull(ContextSpecificTag(TAG_LATEST_VALUE)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -73,32 +71,45 @@ class AccessControlClusterAccessControlExtensionChangedEvent ( private const val TAG_LATEST_VALUE = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlExtensionChangedEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): AccessControlClusterAccessControlExtensionChangedEvent { tlvReader.enterStructure(tag) - val adminNodeID = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) - null - } - val adminPasscodeID = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) - null - } + val adminNodeID = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_NODE_I_D)) + null + } + val adminPasscodeID = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ADMIN_PASSCODE_I_D)) + null + } val changeType = tlvReader.getInt(ContextSpecificTag(TAG_CHANGE_TYPE)) - val latestValue = if (!tlvReader.isNull()) { - chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct.fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) - null - } + val latestValue = + if (!tlvReader.isNull()) { + chip.devicecontroller.cluster.structs.AccessControlClusterAccessControlExtensionStruct + .fromTlv(ContextSpecificTag(TAG_LATEST_VALUE), tlvReader) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LATEST_VALUE)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return AccessControlClusterAccessControlExtensionChangedEvent(adminNodeID, adminPasscodeID, changeType, latestValue, fabricIndex) + return AccessControlClusterAccessControlExtensionChangedEvent( + adminNodeID, + adminPasscodeID, + changeType, + latestValue, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt index 167cdbeaebfee4..d2e375338f705d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterActionFailedEvent.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ActionsClusterActionFailedEvent ( - val actionID: Int, - val invokeID: Long, - val newState: Int, - val error: Int) { - override fun toString(): String = buildString { +class ActionsClusterActionFailedEvent( + val actionID: Int, + val invokeID: Long, + val newState: Int, + val error: Int +) { + override fun toString(): String = buildString { append("ActionsClusterActionFailedEvent {\n") append("\tactionID : $actionID\n") append("\tinvokeID : $invokeID\n") @@ -57,13 +54,13 @@ class ActionsClusterActionFailedEvent ( private const val TAG_NEW_STATE = 2 private const val TAG_ERROR = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterActionFailedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterActionFailedEvent { tlvReader.enterStructure(tag) val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D)) val invokeID = tlvReader.getLong(ContextSpecificTag(TAG_INVOKE_I_D)) val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE)) val error = tlvReader.getInt(ContextSpecificTag(TAG_ERROR)) - + tlvReader.exitContainer() return ActionsClusterActionFailedEvent(actionID, invokeID, newState, error) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt index cd461b0ff538ef..05ad68aae272ea 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ActionsClusterStateChangedEvent.kt @@ -17,20 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ActionsClusterStateChangedEvent ( - val actionID: Int, - val invokeID: Long, - val newState: Int) { - override fun toString(): String = buildString { +class ActionsClusterStateChangedEvent(val actionID: Int, val invokeID: Long, val newState: Int) { + override fun toString(): String = buildString { append("ActionsClusterStateChangedEvent {\n") append("\tactionID : $actionID\n") append("\tinvokeID : $invokeID\n") @@ -53,12 +46,12 @@ class ActionsClusterStateChangedEvent ( private const val TAG_INVOKE_I_D = 1 private const val TAG_NEW_STATE = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterStateChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterStateChangedEvent { tlvReader.enterStructure(tag) val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D)) val invokeID = tlvReader.getLong(ContextSpecificTag(TAG_INVOKE_I_D)) val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE)) - + tlvReader.exitContainer() return ActionsClusterStateChangedEvent(actionID, invokeID, newState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt index e45d705386325c..962ed26cddb40d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterLeaveEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BasicInformationClusterLeaveEvent ( - val fabricIndex: Int) { - override fun toString(): String = buildString { +class BasicInformationClusterLeaveEvent(val fabricIndex: Int) { + override fun toString(): String = buildString { append("BasicInformationClusterLeaveEvent {\n") append("\tfabricIndex : $fabricIndex\n") append("}\n") @@ -45,10 +40,10 @@ class BasicInformationClusterLeaveEvent ( companion object { private const val TAG_FABRIC_INDEX = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterLeaveEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterLeaveEvent { tlvReader.enterStructure(tag) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return BasicInformationClusterLeaveEvent(fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt index 025e619be435d4..c40211aa617dcc 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterReachableChangedEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BasicInformationClusterReachableChangedEvent ( - val reachableNewValue: Boolean) { - override fun toString(): String = buildString { +class BasicInformationClusterReachableChangedEvent(val reachableNewValue: Boolean) { + override fun toString(): String = buildString { append("BasicInformationClusterReachableChangedEvent {\n") append("\treachableNewValue : $reachableNewValue\n") append("}\n") @@ -45,10 +40,10 @@ class BasicInformationClusterReachableChangedEvent ( companion object { private const val TAG_REACHABLE_NEW_VALUE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterReachableChangedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterReachableChangedEvent { tlvReader.enterStructure(tag) val reachableNewValue = tlvReader.getBoolean(ContextSpecificTag(TAG_REACHABLE_NEW_VALUE)) - + tlvReader.exitContainer() return BasicInformationClusterReachableChangedEvent(reachableNewValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt index f0ab0ec9b2e99f..23082666b05cae 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BasicInformationClusterStartUpEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BasicInformationClusterStartUpEvent ( - val softwareVersion: Long) { - override fun toString(): String = buildString { +class BasicInformationClusterStartUpEvent(val softwareVersion: Long) { + override fun toString(): String = buildString { append("BasicInformationClusterStartUpEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("}\n") @@ -45,10 +40,10 @@ class BasicInformationClusterStartUpEvent ( companion object { private const val TAG_SOFTWARE_VERSION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterStartUpEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterStartUpEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) - + tlvReader.exitContainer() return BasicInformationClusterStartUpEvent(softwareVersion) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt index 8194ba7d1f742d..a0ecfb76141580 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BooleanStateClusterStateChangeEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BooleanStateClusterStateChangeEvent ( - val stateValue: Boolean) { - override fun toString(): String = buildString { +class BooleanStateClusterStateChangeEvent(val stateValue: Boolean) { + override fun toString(): String = buildString { append("BooleanStateClusterStateChangeEvent {\n") append("\tstateValue : $stateValue\n") append("}\n") @@ -45,10 +40,10 @@ class BooleanStateClusterStateChangeEvent ( companion object { private const val TAG_STATE_VALUE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BooleanStateClusterStateChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BooleanStateClusterStateChangeEvent { tlvReader.enterStructure(tag) val stateValue = tlvReader.getBoolean(ContextSpecificTag(TAG_STATE_VALUE)) - + tlvReader.exitContainer() return BooleanStateClusterStateChangeEvent(stateValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt index c66f3595c88152..e75b2f7af96f93 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BridgedDeviceBasicInformationClusterReachableChangedEvent ( - val reachableNewValue: Boolean) { - override fun toString(): String = buildString { +class BridgedDeviceBasicInformationClusterReachableChangedEvent(val reachableNewValue: Boolean) { + override fun toString(): String = buildString { append("BridgedDeviceBasicInformationClusterReachableChangedEvent {\n") append("\treachableNewValue : $reachableNewValue\n") append("}\n") @@ -45,10 +40,13 @@ class BridgedDeviceBasicInformationClusterReachableChangedEvent ( companion object { private const val TAG_REACHABLE_NEW_VALUE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BridgedDeviceBasicInformationClusterReachableChangedEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): BridgedDeviceBasicInformationClusterReachableChangedEvent { tlvReader.enterStructure(tag) val reachableNewValue = tlvReader.getBoolean(ContextSpecificTag(TAG_REACHABLE_NEW_VALUE)) - + tlvReader.exitContainer() return BridgedDeviceBasicInformationClusterReachableChangedEvent(reachableNewValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt index 9b1e886926c1bd..80c60be6847056 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BridgedDeviceBasicInformationClusterStartUpEvent ( - val softwareVersion: Long) { - override fun toString(): String = buildString { +class BridgedDeviceBasicInformationClusterStartUpEvent(val softwareVersion: Long) { + override fun toString(): String = buildString { append("BridgedDeviceBasicInformationClusterStartUpEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("}\n") @@ -45,10 +40,10 @@ class BridgedDeviceBasicInformationClusterStartUpEvent ( companion object { private const val TAG_SOFTWARE_VERSION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BridgedDeviceBasicInformationClusterStartUpEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BridgedDeviceBasicInformationClusterStartUpEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) - + tlvReader.exitContainer() return BridgedDeviceBasicInformationClusterStartUpEvent(softwareVersion) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt index b2a29696b191a8..0b7206788e842a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DishwasherAlarmClusterNotifyEvent.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DishwasherAlarmClusterNotifyEvent ( - val active: Long, - val inactive: Long, - val state: Long, - val mask: Long) { - override fun toString(): String = buildString { +class DishwasherAlarmClusterNotifyEvent( + val active: Long, + val inactive: Long, + val state: Long, + val mask: Long +) { + override fun toString(): String = buildString { append("DishwasherAlarmClusterNotifyEvent {\n") append("\tactive : $active\n") append("\tinactive : $inactive\n") @@ -57,13 +54,13 @@ class DishwasherAlarmClusterNotifyEvent ( private const val TAG_STATE = 2 private const val TAG_MASK = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DishwasherAlarmClusterNotifyEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DishwasherAlarmClusterNotifyEvent { tlvReader.enterStructure(tag) val active = tlvReader.getLong(ContextSpecificTag(TAG_ACTIVE)) val inactive = tlvReader.getLong(ContextSpecificTag(TAG_INACTIVE)) val state = tlvReader.getLong(ContextSpecificTag(TAG_STATE)) val mask = tlvReader.getLong(ContextSpecificTag(TAG_MASK)) - + tlvReader.exitContainer() return DishwasherAlarmClusterNotifyEvent(active, inactive, state, mask) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt index 309eb4e52c29f2..6417fb85009e88 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorLockAlarmEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DoorLockClusterDoorLockAlarmEvent ( - val alarmCode: Int) { - override fun toString(): String = buildString { +class DoorLockClusterDoorLockAlarmEvent(val alarmCode: Int) { + override fun toString(): String = buildString { append("DoorLockClusterDoorLockAlarmEvent {\n") append("\talarmCode : $alarmCode\n") append("}\n") @@ -45,10 +40,10 @@ class DoorLockClusterDoorLockAlarmEvent ( companion object { private const val TAG_ALARM_CODE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterDoorLockAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterDoorLockAlarmEvent { tlvReader.enterStructure(tag) val alarmCode = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_CODE)) - + tlvReader.exitContainer() return DoorLockClusterDoorLockAlarmEvent(alarmCode) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt index 05068118f56c59..d0b6acbe7ea227 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterDoorStateChangeEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DoorLockClusterDoorStateChangeEvent ( - val doorState: Int) { - override fun toString(): String = buildString { +class DoorLockClusterDoorStateChangeEvent(val doorState: Int) { + override fun toString(): String = buildString { append("DoorLockClusterDoorStateChangeEvent {\n") append("\tdoorState : $doorState\n") append("}\n") @@ -45,10 +40,10 @@ class DoorLockClusterDoorStateChangeEvent ( companion object { private const val TAG_DOOR_STATE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterDoorStateChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterDoorStateChangeEvent { tlvReader.enterStructure(tag) val doorState = tlvReader.getInt(ContextSpecificTag(TAG_DOOR_STATE)) - + tlvReader.exitContainer() return DoorLockClusterDoorStateChangeEvent(doorState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt index 34dd208597b65e..59e38fa054dd87 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationErrorEvent.kt @@ -20,21 +20,21 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class DoorLockClusterLockOperationErrorEvent ( - val lockOperationType: Int, - val operationSource: Int, - val operationError: Int, - val userIndex: Int?, - val fabricIndex: Int?, - val sourceNode: Long?, - val credentials: Optional>?) { - override fun toString(): String = buildString { +class DoorLockClusterLockOperationErrorEvent( + val lockOperationType: Int, + val operationSource: Int, + val operationError: Int, + val userIndex: Int?, + val fabricIndex: Int?, + val sourceNode: Long?, + val credentials: + Optional>? +) { + override fun toString(): String = buildString { append("DoorLockClusterLockOperationErrorEvent {\n") append("\tlockOperationType : $lockOperationType\n") append("\toperationSource : $operationSource\n") @@ -53,32 +53,32 @@ class DoorLockClusterLockOperationErrorEvent ( put(ContextSpecificTag(TAG_OPERATION_SOURCE), operationSource) put(ContextSpecificTag(TAG_OPERATION_ERROR), operationError) if (userIndex != null) { - put(ContextSpecificTag(TAG_USER_INDEX), userIndex) - } else { - putNull(ContextSpecificTag(TAG_USER_INDEX)) - } + put(ContextSpecificTag(TAG_USER_INDEX), userIndex) + } else { + putNull(ContextSpecificTag(TAG_USER_INDEX)) + } if (fabricIndex != null) { - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) - } else { - putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - } + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + } else { + putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + } if (sourceNode != null) { - put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) - } else { - putNull(ContextSpecificTag(TAG_SOURCE_NODE)) - } + put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) + } else { + putNull(ContextSpecificTag(TAG_SOURCE_NODE)) + } if (credentials != null) { - if (credentials.isPresent) { - val optcredentials = credentials.get() - startList(ContextSpecificTag(TAG_CREDENTIALS)) - for (item in optcredentials.iterator()) { - item.toTlv(AnonymousTag, this) + if (credentials.isPresent) { + val optcredentials = credentials.get() + startList(ContextSpecificTag(TAG_CREDENTIALS)) + for (item in optcredentials.iterator()) { + item.toTlv(AnonymousTag, this) + } + endList() + } + } else { + putNull(ContextSpecificTag(TAG_CREDENTIALS)) } - endList() - } - } else { - putNull(ContextSpecificTag(TAG_CREDENTIALS)) - } endStructure() } } @@ -92,49 +92,68 @@ class DoorLockClusterLockOperationErrorEvent ( private const val TAG_SOURCE_NODE = 5 private const val TAG_CREDENTIALS = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterLockOperationErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterLockOperationErrorEvent { tlvReader.enterStructure(tag) val lockOperationType = tlvReader.getInt(ContextSpecificTag(TAG_LOCK_OPERATION_TYPE)) val operationSource = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_SOURCE)) val operationError = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_ERROR)) - val userIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) - null - } - val fabricIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - null - } - val sourceNode = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) - null - } - val credentials = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { - Optional.of(buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) - while(!tlvReader.isEndOfContainer()) { - this.add(chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - }) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) - null - } - + val userIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) + null + } + val fabricIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + null + } + val sourceNode = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) + null + } + val credentials = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { + Optional.of( + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) + while (!tlvReader.isEndOfContainer()) { + this.add( + chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv( + AnonymousTag, + tlvReader + ) + ) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) + null + } + tlvReader.exitContainer() - return DoorLockClusterLockOperationErrorEvent(lockOperationType, operationSource, operationError, userIndex, fabricIndex, sourceNode, credentials) + return DoorLockClusterLockOperationErrorEvent( + lockOperationType, + operationSource, + operationError, + userIndex, + fabricIndex, + sourceNode, + credentials + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt index d1f83b46c08222..4fbf71082c7adc 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockOperationEvent.kt @@ -20,20 +20,20 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class DoorLockClusterLockOperationEvent ( - val lockOperationType: Int, - val operationSource: Int, - val userIndex: Int?, - val fabricIndex: Int?, - val sourceNode: Long?, - val credentials: Optional>?) { - override fun toString(): String = buildString { +class DoorLockClusterLockOperationEvent( + val lockOperationType: Int, + val operationSource: Int, + val userIndex: Int?, + val fabricIndex: Int?, + val sourceNode: Long?, + val credentials: + Optional>? +) { + override fun toString(): String = buildString { append("DoorLockClusterLockOperationEvent {\n") append("\tlockOperationType : $lockOperationType\n") append("\toperationSource : $operationSource\n") @@ -50,32 +50,32 @@ class DoorLockClusterLockOperationEvent ( put(ContextSpecificTag(TAG_LOCK_OPERATION_TYPE), lockOperationType) put(ContextSpecificTag(TAG_OPERATION_SOURCE), operationSource) if (userIndex != null) { - put(ContextSpecificTag(TAG_USER_INDEX), userIndex) - } else { - putNull(ContextSpecificTag(TAG_USER_INDEX)) - } + put(ContextSpecificTag(TAG_USER_INDEX), userIndex) + } else { + putNull(ContextSpecificTag(TAG_USER_INDEX)) + } if (fabricIndex != null) { - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) - } else { - putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - } + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + } else { + putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + } if (sourceNode != null) { - put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) - } else { - putNull(ContextSpecificTag(TAG_SOURCE_NODE)) - } + put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) + } else { + putNull(ContextSpecificTag(TAG_SOURCE_NODE)) + } if (credentials != null) { - if (credentials.isPresent) { - val optcredentials = credentials.get() - startList(ContextSpecificTag(TAG_CREDENTIALS)) - for (item in optcredentials.iterator()) { - item.toTlv(AnonymousTag, this) + if (credentials.isPresent) { + val optcredentials = credentials.get() + startList(ContextSpecificTag(TAG_CREDENTIALS)) + for (item in optcredentials.iterator()) { + item.toTlv(AnonymousTag, this) + } + endList() + } + } else { + putNull(ContextSpecificTag(TAG_CREDENTIALS)) } - endList() - } - } else { - putNull(ContextSpecificTag(TAG_CREDENTIALS)) - } endStructure() } } @@ -88,48 +88,66 @@ class DoorLockClusterLockOperationEvent ( private const val TAG_SOURCE_NODE = 4 private const val TAG_CREDENTIALS = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterLockOperationEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterLockOperationEvent { tlvReader.enterStructure(tag) val lockOperationType = tlvReader.getInt(ContextSpecificTag(TAG_LOCK_OPERATION_TYPE)) val operationSource = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_SOURCE)) - val userIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) - null - } - val fabricIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - null - } - val sourceNode = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) - null - } - val credentials = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { - Optional.of(buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) - while(!tlvReader.isEndOfContainer()) { - this.add(chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - }) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) - null - } - + val userIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) + null + } + val fabricIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + null + } + val sourceNode = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) + null + } + val credentials = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIALS))) { + Optional.of( + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CREDENTIALS)) + while (!tlvReader.isEndOfContainer()) { + this.add( + chip.devicecontroller.cluster.structs.DoorLockClusterCredentialStruct.fromTlv( + AnonymousTag, + tlvReader + ) + ) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CREDENTIALS)) + null + } + tlvReader.exitContainer() - return DoorLockClusterLockOperationEvent(lockOperationType, operationSource, userIndex, fabricIndex, sourceNode, credentials) + return DoorLockClusterLockOperationEvent( + lockOperationType, + operationSource, + userIndex, + fabricIndex, + sourceNode, + credentials + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt index c8b7dd9380bb7f..6fc562b39959ff 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DoorLockClusterLockUserChangeEvent.kt @@ -17,24 +17,21 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DoorLockClusterLockUserChangeEvent ( - val lockDataType: Int, - val dataOperationType: Int, - val operationSource: Int, - val userIndex: Int?, - val fabricIndex: Int?, - val sourceNode: Long?, - val dataIndex: Int?) { - override fun toString(): String = buildString { +class DoorLockClusterLockUserChangeEvent( + val lockDataType: Int, + val dataOperationType: Int, + val operationSource: Int, + val userIndex: Int?, + val fabricIndex: Int?, + val sourceNode: Long?, + val dataIndex: Int? +) { + override fun toString(): String = buildString { append("DoorLockClusterLockUserChangeEvent {\n") append("\tlockDataType : $lockDataType\n") append("\tdataOperationType : $dataOperationType\n") @@ -53,25 +50,25 @@ class DoorLockClusterLockUserChangeEvent ( put(ContextSpecificTag(TAG_DATA_OPERATION_TYPE), dataOperationType) put(ContextSpecificTag(TAG_OPERATION_SOURCE), operationSource) if (userIndex != null) { - put(ContextSpecificTag(TAG_USER_INDEX), userIndex) - } else { - putNull(ContextSpecificTag(TAG_USER_INDEX)) - } + put(ContextSpecificTag(TAG_USER_INDEX), userIndex) + } else { + putNull(ContextSpecificTag(TAG_USER_INDEX)) + } if (fabricIndex != null) { - put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) - } else { - putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - } + put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) + } else { + putNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + } if (sourceNode != null) { - put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) - } else { - putNull(ContextSpecificTag(TAG_SOURCE_NODE)) - } + put(ContextSpecificTag(TAG_SOURCE_NODE), sourceNode) + } else { + putNull(ContextSpecificTag(TAG_SOURCE_NODE)) + } if (dataIndex != null) { - put(ContextSpecificTag(TAG_DATA_INDEX), dataIndex) - } else { - putNull(ContextSpecificTag(TAG_DATA_INDEX)) - } + put(ContextSpecificTag(TAG_DATA_INDEX), dataIndex) + } else { + putNull(ContextSpecificTag(TAG_DATA_INDEX)) + } endStructure() } } @@ -85,39 +82,51 @@ class DoorLockClusterLockUserChangeEvent ( private const val TAG_SOURCE_NODE = 5 private const val TAG_DATA_INDEX = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterLockUserChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterLockUserChangeEvent { tlvReader.enterStructure(tag) val lockDataType = tlvReader.getInt(ContextSpecificTag(TAG_LOCK_DATA_TYPE)) val dataOperationType = tlvReader.getInt(ContextSpecificTag(TAG_DATA_OPERATION_TYPE)) val operationSource = tlvReader.getInt(ContextSpecificTag(TAG_OPERATION_SOURCE)) - val userIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) - null - } - val fabricIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) - null - } - val sourceNode = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) - null - } - val dataIndex = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_DATA_INDEX)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_DATA_INDEX)) - null - } - + val userIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_USER_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_USER_INDEX)) + null + } + val fabricIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FABRIC_INDEX)) + null + } + val sourceNode = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_SOURCE_NODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SOURCE_NODE)) + null + } + val dataIndex = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_DATA_INDEX)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_DATA_INDEX)) + null + } + tlvReader.exitContainer() - return DoorLockClusterLockUserChangeEvent(lockDataType, dataOperationType, operationSource, userIndex, fabricIndex, sourceNode, dataIndex) + return DoorLockClusterLockUserChangeEvent( + lockDataType, + dataOperationType, + operationSource, + userIndex, + fabricIndex, + sourceNode, + dataIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt index 79b58b0d67cdae..3d743983f1a00f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterBootReasonEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GeneralDiagnosticsClusterBootReasonEvent ( - val bootReason: Int) { - override fun toString(): String = buildString { +class GeneralDiagnosticsClusterBootReasonEvent(val bootReason: Int) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterBootReasonEvent {\n") append("\tbootReason : $bootReason\n") append("}\n") @@ -45,10 +40,10 @@ class GeneralDiagnosticsClusterBootReasonEvent ( companion object { private const val TAG_BOOT_REASON = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterBootReasonEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterBootReasonEvent { tlvReader.enterStructure(tag) val bootReason = tlvReader.getInt(ContextSpecificTag(TAG_BOOT_REASON)) - + tlvReader.exitContainer() return GeneralDiagnosticsClusterBootReasonEvent(bootReason) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt index 207d45c24e3c40..1287eba322b742 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterHardwareFaultChangeEvent.kt @@ -20,16 +20,14 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GeneralDiagnosticsClusterHardwareFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class GeneralDiagnosticsClusterHardwareFaultChangeEvent( + val current: List, + val previous: List +) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterHardwareFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +55,25 @@ class GeneralDiagnosticsClusterHardwareFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterHardwareFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterHardwareFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return GeneralDiagnosticsClusterHardwareFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt index 5fed1abd0f4c09..f9fc3cadc8b934 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterNetworkFaultChangeEvent.kt @@ -20,16 +20,14 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GeneralDiagnosticsClusterNetworkFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class GeneralDiagnosticsClusterNetworkFaultChangeEvent( + val current: List, + val previous: List +) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterNetworkFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +55,25 @@ class GeneralDiagnosticsClusterNetworkFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterNetworkFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterNetworkFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return GeneralDiagnosticsClusterNetworkFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt index 7a0b4e386ca3f9..35daf8dd691bf5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/GeneralDiagnosticsClusterRadioFaultChangeEvent.kt @@ -20,16 +20,14 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GeneralDiagnosticsClusterRadioFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class GeneralDiagnosticsClusterRadioFaultChangeEvent( + val current: List, + val previous: List +) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterRadioFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +55,25 @@ class GeneralDiagnosticsClusterRadioFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterRadioFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterRadioFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return GeneralDiagnosticsClusterRadioFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt index 8e0999dbb5eed6..092e062784a118 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationCompletionEvent.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class OperationalStateClusterOperationCompletionEvent ( - val completionErrorCode: Int, - val totalOperationalTime: Optional?, - val pausedTime: Optional?) { - override fun toString(): String = buildString { +class OperationalStateClusterOperationCompletionEvent( + val completionErrorCode: Int, + val totalOperationalTime: Optional?, + val pausedTime: Optional? +) { + override fun toString(): String = buildString { append("OperationalStateClusterOperationCompletionEvent {\n") append("\tcompletionErrorCode : $completionErrorCode\n") append("\ttotalOperationalTime : $totalOperationalTime\n") @@ -43,21 +41,21 @@ class OperationalStateClusterOperationCompletionEvent ( startStructure(tag) put(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE), completionErrorCode) if (totalOperationalTime != null) { - if (totalOperationalTime.isPresent) { - val opttotalOperationalTime = totalOperationalTime.get() - put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) - } - } else { - putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - } + if (totalOperationalTime.isPresent) { + val opttotalOperationalTime = totalOperationalTime.get() + put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) + } + } else { + putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + } if (pausedTime != null) { - if (pausedTime.isPresent) { - val optpausedTime = pausedTime.get() - put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) - } - } else { - putNull(ContextSpecificTag(TAG_PAUSED_TIME)) - } + if (pausedTime.isPresent) { + val optpausedTime = pausedTime.get() + put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) + } + } else { + putNull(ContextSpecificTag(TAG_PAUSED_TIME)) + } endStructure() } } @@ -67,33 +65,39 @@ class OperationalStateClusterOperationCompletionEvent ( private const val TAG_TOTAL_OPERATIONAL_TIME = 1 private const val TAG_PAUSED_TIME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterOperationCompletionEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterOperationCompletionEvent { tlvReader.enterStructure(tag) val completionErrorCode = tlvReader.getInt(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE)) - val totalOperationalTime = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - null - } - val pausedTime = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) - null - } - + val totalOperationalTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + null + } + val pausedTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) + null + } + tlvReader.exitContainer() - return OperationalStateClusterOperationCompletionEvent(completionErrorCode, totalOperationalTime, pausedTime) + return OperationalStateClusterOperationCompletionEvent( + completionErrorCode, + totalOperationalTime, + pausedTime + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt index ef4633c2ffe087..b5623a0d701579 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OperationalStateClusterOperationalErrorEvent.kt @@ -17,18 +17,15 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OperationalStateClusterOperationalErrorEvent ( - val errorState: chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct) { - override fun toString(): String = buildString { +class OperationalStateClusterOperationalErrorEvent( + val errorState: chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct +) { + override fun toString(): String = buildString { append("OperationalStateClusterOperationalErrorEvent {\n") append("\terrorState : $errorState\n") append("}\n") @@ -45,10 +42,14 @@ class OperationalStateClusterOperationalErrorEvent ( companion object { private const val TAG_ERROR_STATE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterOperationalErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterOperationalErrorEvent { tlvReader.enterStructure(tag) - val errorState = chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct.fromTlv(ContextSpecificTag(TAG_ERROR_STATE), tlvReader) - + val errorState = + chip.devicecontroller.cluster.structs.OperationalStateClusterErrorStateStruct.fromTlv( + ContextSpecificTag(TAG_ERROR_STATE), + tlvReader + ) + tlvReader.exitContainer() return OperationalStateClusterOperationalErrorEvent(errorState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt index 3e7ac690e0fbab..8a82cbf93c9f1f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterDownloadErrorEvent.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent ( - val softwareVersion: Long, - val bytesDownloaded: Long, - val progressPercent: Int?, - val platformCode: Long?) { - override fun toString(): String = buildString { +class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent( + val softwareVersion: Long, + val bytesDownloaded: Long, + val progressPercent: Int?, + val platformCode: Long? +) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterDownloadErrorEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("\tbytesDownloaded : $bytesDownloaded\n") @@ -46,15 +43,15 @@ class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent ( put(ContextSpecificTag(TAG_SOFTWARE_VERSION), softwareVersion) put(ContextSpecificTag(TAG_BYTES_DOWNLOADED), bytesDownloaded) if (progressPercent != null) { - put(ContextSpecificTag(TAG_PROGRESS_PERCENT), progressPercent) - } else { - putNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) - } + put(ContextSpecificTag(TAG_PROGRESS_PERCENT), progressPercent) + } else { + putNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) + } if (platformCode != null) { - put(ContextSpecificTag(TAG_PLATFORM_CODE), platformCode) - } else { - putNull(ContextSpecificTag(TAG_PLATFORM_CODE)) - } + put(ContextSpecificTag(TAG_PLATFORM_CODE), platformCode) + } else { + putNull(ContextSpecificTag(TAG_PLATFORM_CODE)) + } endStructure() } } @@ -65,26 +62,36 @@ class OtaSoftwareUpdateRequestorClusterDownloadErrorEvent ( private const val TAG_PROGRESS_PERCENT = 2 private const val TAG_PLATFORM_CODE = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterDownloadErrorEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): OtaSoftwareUpdateRequestorClusterDownloadErrorEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) val bytesDownloaded = tlvReader.getLong(ContextSpecificTag(TAG_BYTES_DOWNLOADED)) - val progressPercent = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_PROGRESS_PERCENT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) - null - } - val platformCode = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_PLATFORM_CODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PLATFORM_CODE)) - null - } - + val progressPercent = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_PROGRESS_PERCENT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PROGRESS_PERCENT)) + null + } + val platformCode = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_PLATFORM_CODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PLATFORM_CODE)) + null + } + tlvReader.exitContainer() - return OtaSoftwareUpdateRequestorClusterDownloadErrorEvent(softwareVersion, bytesDownloaded, progressPercent, platformCode) + return OtaSoftwareUpdateRequestorClusterDownloadErrorEvent( + softwareVersion, + bytesDownloaded, + progressPercent, + platformCode + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt index bcd1db0f6990bf..b0b075689fc3be 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterStateTransitionEvent.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OtaSoftwareUpdateRequestorClusterStateTransitionEvent ( - val previousState: Int, - val newState: Int, - val reason: Int, - val targetSoftwareVersion: Long?) { - override fun toString(): String = buildString { +class OtaSoftwareUpdateRequestorClusterStateTransitionEvent( + val previousState: Int, + val newState: Int, + val reason: Int, + val targetSoftwareVersion: Long? +) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterStateTransitionEvent {\n") append("\tpreviousState : $previousState\n") append("\tnewState : $newState\n") @@ -47,10 +44,10 @@ class OtaSoftwareUpdateRequestorClusterStateTransitionEvent ( put(ContextSpecificTag(TAG_NEW_STATE), newState) put(ContextSpecificTag(TAG_REASON), reason) if (targetSoftwareVersion != null) { - put(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION), targetSoftwareVersion) - } else { - putNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) - } + put(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION), targetSoftwareVersion) + } else { + putNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) + } endStructure() } } @@ -61,21 +58,30 @@ class OtaSoftwareUpdateRequestorClusterStateTransitionEvent ( private const val TAG_REASON = 2 private const val TAG_TARGET_SOFTWARE_VERSION = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterStateTransitionEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): OtaSoftwareUpdateRequestorClusterStateTransitionEvent { tlvReader.enterStructure(tag) val previousState = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_STATE)) val newState = tlvReader.getInt(ContextSpecificTag(TAG_NEW_STATE)) val reason = tlvReader.getInt(ContextSpecificTag(TAG_REASON)) - val targetSoftwareVersion = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) - null - } - + val targetSoftwareVersion = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TARGET_SOFTWARE_VERSION)) + null + } + tlvReader.exitContainer() - return OtaSoftwareUpdateRequestorClusterStateTransitionEvent(previousState, newState, reason, targetSoftwareVersion) + return OtaSoftwareUpdateRequestorClusterStateTransitionEvent( + previousState, + newState, + reason, + targetSoftwareVersion + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt index 96bb018c4e0bd0..ff1034ace97e31 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/OtaSoftwareUpdateRequestorClusterVersionAppliedEvent.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OtaSoftwareUpdateRequestorClusterVersionAppliedEvent ( - val softwareVersion: Long, - val productID: Int) { - override fun toString(): String = buildString { +class OtaSoftwareUpdateRequestorClusterVersionAppliedEvent( + val softwareVersion: Long, + val productID: Int +) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterVersionAppliedEvent {\n") append("\tsoftwareVersion : $softwareVersion\n") append("\tproductID : $productID\n") @@ -49,11 +46,14 @@ class OtaSoftwareUpdateRequestorClusterVersionAppliedEvent ( private const val TAG_SOFTWARE_VERSION = 0 private const val TAG_PRODUCT_I_D = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterVersionAppliedEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): OtaSoftwareUpdateRequestorClusterVersionAppliedEvent { tlvReader.enterStructure(tag) val softwareVersion = tlvReader.getLong(ContextSpecificTag(TAG_SOFTWARE_VERSION)) val productID = tlvReader.getInt(ContextSpecificTag(TAG_PRODUCT_I_D)) - + tlvReader.exitContainer() return OtaSoftwareUpdateRequestorClusterVersionAppliedEvent(softwareVersion, productID) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt index eb8be2f538a999..c3eb0d1e658b56 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatChargeFaultChangeEvent.kt @@ -20,16 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class PowerSourceClusterBatChargeFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class PowerSourceClusterBatChargeFaultChangeEvent(val current: List, val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatChargeFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +52,25 @@ class PowerSourceClusterBatChargeFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatChargeFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatChargeFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatChargeFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt index 782fba2707b2f5..c010184156ecb3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterBatFaultChangeEvent.kt @@ -20,16 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class PowerSourceClusterBatFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class PowerSourceClusterBatFaultChangeEvent(val current: List, val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +52,25 @@ class PowerSourceClusterBatFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt index 1906ef9014899d..8a06b36fba61d0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/PowerSourceClusterWiredFaultChangeEvent.kt @@ -20,16 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class PowerSourceClusterWiredFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class PowerSourceClusterWiredFaultChangeEvent(val current: List, val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterWiredFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +52,25 @@ class PowerSourceClusterWiredFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterWiredFaultChangeEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterWiredFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterWiredFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt index a67296515fc256..c116f16ac73229 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RefrigeratorAlarmClusterNotifyEvent.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class RefrigeratorAlarmClusterNotifyEvent ( - val active: Long, - val inactive: Long, - val state: Long, - val mask: Long) { - override fun toString(): String = buildString { +class RefrigeratorAlarmClusterNotifyEvent( + val active: Long, + val inactive: Long, + val state: Long, + val mask: Long +) { + override fun toString(): String = buildString { append("RefrigeratorAlarmClusterNotifyEvent {\n") append("\tactive : $active\n") append("\tinactive : $inactive\n") @@ -57,13 +54,13 @@ class RefrigeratorAlarmClusterNotifyEvent ( private const val TAG_STATE = 2 private const val TAG_MASK = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RefrigeratorAlarmClusterNotifyEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RefrigeratorAlarmClusterNotifyEvent { tlvReader.enterStructure(tag) val active = tlvReader.getLong(ContextSpecificTag(TAG_ACTIVE)) val inactive = tlvReader.getLong(ContextSpecificTag(TAG_INACTIVE)) val state = tlvReader.getLong(ContextSpecificTag(TAG_STATE)) val mask = tlvReader.getLong(ContextSpecificTag(TAG_MASK)) - + tlvReader.exitContainer() return RefrigeratorAlarmClusterNotifyEvent(active, inactive, state, mask) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt index f43dd669cf87ca..c6afaa9750adf8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationCompletionEvent.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class RvcOperationalStateClusterOperationCompletionEvent ( - val completionErrorCode: Int, - val totalOperationalTime: Optional?, - val pausedTime: Optional?) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterOperationCompletionEvent( + val completionErrorCode: Int, + val totalOperationalTime: Optional?, + val pausedTime: Optional? +) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterOperationCompletionEvent {\n") append("\tcompletionErrorCode : $completionErrorCode\n") append("\ttotalOperationalTime : $totalOperationalTime\n") @@ -43,21 +41,21 @@ class RvcOperationalStateClusterOperationCompletionEvent ( startStructure(tag) put(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE), completionErrorCode) if (totalOperationalTime != null) { - if (totalOperationalTime.isPresent) { - val opttotalOperationalTime = totalOperationalTime.get() - put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) - } - } else { - putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - } + if (totalOperationalTime.isPresent) { + val opttotalOperationalTime = totalOperationalTime.get() + put(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME), opttotalOperationalTime) + } + } else { + putNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + } if (pausedTime != null) { - if (pausedTime.isPresent) { - val optpausedTime = pausedTime.get() - put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) - } - } else { - putNull(ContextSpecificTag(TAG_PAUSED_TIME)) - } + if (pausedTime.isPresent) { + val optpausedTime = pausedTime.get() + put(ContextSpecificTag(TAG_PAUSED_TIME), optpausedTime) + } + } else { + putNull(ContextSpecificTag(TAG_PAUSED_TIME)) + } endStructure() } } @@ -67,33 +65,42 @@ class RvcOperationalStateClusterOperationCompletionEvent ( private const val TAG_TOTAL_OPERATIONAL_TIME = 1 private const val TAG_PAUSED_TIME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterOperationCompletionEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): RvcOperationalStateClusterOperationCompletionEvent { tlvReader.enterStructure(tag) val completionErrorCode = tlvReader.getInt(ContextSpecificTag(TAG_COMPLETION_ERROR_CODE)) - val totalOperationalTime = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) - null - } - val pausedTime = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) - null - } - + val totalOperationalTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TOTAL_OPERATIONAL_TIME)) + null + } + val pausedTime = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PAUSED_TIME))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_PAUSED_TIME))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PAUSED_TIME)) + null + } + tlvReader.exitContainer() - return RvcOperationalStateClusterOperationCompletionEvent(completionErrorCode, totalOperationalTime, pausedTime) + return RvcOperationalStateClusterOperationCompletionEvent( + completionErrorCode, + totalOperationalTime, + pausedTime + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt index ee80a6e06fb3a6..bf6fed9817f60f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/RvcOperationalStateClusterOperationalErrorEvent.kt @@ -17,18 +17,15 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class RvcOperationalStateClusterOperationalErrorEvent ( - val errorState: chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterOperationalErrorEvent( + val errorState: chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct +) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterOperationalErrorEvent {\n") append("\terrorState : $errorState\n") append("}\n") @@ -45,10 +42,14 @@ class RvcOperationalStateClusterOperationalErrorEvent ( companion object { private const val TAG_ERROR_STATE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterOperationalErrorEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcOperationalStateClusterOperationalErrorEvent { tlvReader.enterStructure(tag) - val errorState = chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct.fromTlv(ContextSpecificTag(TAG_ERROR_STATE), tlvReader) - + val errorState = + chip.devicecontroller.cluster.structs.RvcOperationalStateClusterErrorStateStruct.fromTlv( + ContextSpecificTag(TAG_ERROR_STATE), + tlvReader + ) + tlvReader.exitContainer() return RvcOperationalStateClusterOperationalErrorEvent(errorState) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt index 0c2e543c57451c..2bc948e2a667b1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterCOAlarmEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SmokeCoAlarmClusterCOAlarmEvent ( - val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +class SmokeCoAlarmClusterCOAlarmEvent(val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterCOAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -45,10 +40,10 @@ class SmokeCoAlarmClusterCOAlarmEvent ( companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterCOAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterCOAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterCOAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt index 6ddfb212cc0515..19223606c4685d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectCOAlarmEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SmokeCoAlarmClusterInterconnectCOAlarmEvent ( - val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +class SmokeCoAlarmClusterInterconnectCOAlarmEvent(val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterInterconnectCOAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -45,10 +40,10 @@ class SmokeCoAlarmClusterInterconnectCOAlarmEvent ( companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterInterconnectCOAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterInterconnectCOAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterInterconnectCOAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt index c3ada5b8d56ba2..38e2fe872915f7 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterInterconnectSmokeAlarmEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent ( - val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent(val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterInterconnectSmokeAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -45,10 +40,10 @@ class SmokeCoAlarmClusterInterconnectSmokeAlarmEvent ( companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterInterconnectSmokeAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterInterconnectSmokeAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterInterconnectSmokeAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt index a1b2573db15fb6..ce2d9ad47341d0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterLowBatteryEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SmokeCoAlarmClusterLowBatteryEvent ( - val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +class SmokeCoAlarmClusterLowBatteryEvent(val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterLowBatteryEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -45,10 +40,10 @@ class SmokeCoAlarmClusterLowBatteryEvent ( companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterLowBatteryEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterLowBatteryEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterLowBatteryEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt index 01753b1e77aa97..324a5d4461a225 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SmokeCoAlarmClusterSmokeAlarmEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SmokeCoAlarmClusterSmokeAlarmEvent ( - val alarmSeverityLevel: Int) { - override fun toString(): String = buildString { +class SmokeCoAlarmClusterSmokeAlarmEvent(val alarmSeverityLevel: Int) { + override fun toString(): String = buildString { append("SmokeCoAlarmClusterSmokeAlarmEvent {\n") append("\talarmSeverityLevel : $alarmSeverityLevel\n") append("}\n") @@ -45,10 +40,10 @@ class SmokeCoAlarmClusterSmokeAlarmEvent ( companion object { private const val TAG_ALARM_SEVERITY_LEVEL = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SmokeCoAlarmClusterSmokeAlarmEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SmokeCoAlarmClusterSmokeAlarmEvent { tlvReader.enterStructure(tag) val alarmSeverityLevel = tlvReader.getInt(ContextSpecificTag(TAG_ALARM_SEVERITY_LEVEL)) - + tlvReader.exitContainer() return SmokeCoAlarmClusterSmokeAlarmEvent(alarmSeverityLevel) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt index 1ae05ccf0043b2..50b455842e538f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SoftwareDiagnosticsClusterSoftwareFaultEvent.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class SoftwareDiagnosticsClusterSoftwareFaultEvent ( - val id: Long, - val name: Optional, - val faultRecording: Optional) { - override fun toString(): String = buildString { +class SoftwareDiagnosticsClusterSoftwareFaultEvent( + val id: Long, + val name: Optional, + val faultRecording: Optional +) { + override fun toString(): String = buildString { append("SoftwareDiagnosticsClusterSoftwareFaultEvent {\n") append("\tid : $id\n") append("\tname : $name\n") @@ -43,13 +41,13 @@ class SoftwareDiagnosticsClusterSoftwareFaultEvent ( startStructure(tag) put(ContextSpecificTag(TAG_ID), id) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } if (faultRecording.isPresent) { - val optfaultRecording = faultRecording.get() - put(ContextSpecificTag(TAG_FAULT_RECORDING), optfaultRecording) - } + val optfaultRecording = faultRecording.get() + put(ContextSpecificTag(TAG_FAULT_RECORDING), optfaultRecording) + } endStructure() } } @@ -59,20 +57,22 @@ class SoftwareDiagnosticsClusterSoftwareFaultEvent ( private const val TAG_NAME = 1 private const val TAG_FAULT_RECORDING = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SoftwareDiagnosticsClusterSoftwareFaultEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SoftwareDiagnosticsClusterSoftwareFaultEvent { tlvReader.enterStructure(tag) val id = tlvReader.getLong(ContextSpecificTag(TAG_ID)) - val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - val faultRecording = if (tlvReader.isNextTag(ContextSpecificTag(TAG_FAULT_RECORDING))) { - Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_FAULT_RECORDING))) - } else { - Optional.empty() - } - + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val faultRecording = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FAULT_RECORDING))) { + Optional.of(tlvReader.getByteArray(ContextSpecificTag(TAG_FAULT_RECORDING))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return SoftwareDiagnosticsClusterSoftwareFaultEvent(id, name, faultRecording) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt index 62973598b9aff5..893412c1f25322 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterInitialPressEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterInitialPressEvent ( - val newPosition: Int) { - override fun toString(): String = buildString { +class SwitchClusterInitialPressEvent(val newPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterInitialPressEvent {\n") append("\tnewPosition : $newPosition\n") append("}\n") @@ -45,10 +40,10 @@ class SwitchClusterInitialPressEvent ( companion object { private const val TAG_NEW_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterInitialPressEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterInitialPressEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - + tlvReader.exitContainer() return SwitchClusterInitialPressEvent(newPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt index d67e1ba0076ca9..3fa420f46ddec3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongPressEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterLongPressEvent ( - val newPosition: Int) { - override fun toString(): String = buildString { +class SwitchClusterLongPressEvent(val newPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterLongPressEvent {\n") append("\tnewPosition : $newPosition\n") append("}\n") @@ -45,10 +40,10 @@ class SwitchClusterLongPressEvent ( companion object { private const val TAG_NEW_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterLongPressEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterLongPressEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - + tlvReader.exitContainer() return SwitchClusterLongPressEvent(newPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt index c26312888c3d2d..eb90698fc735ab 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterLongReleaseEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterLongReleaseEvent ( - val previousPosition: Int) { - override fun toString(): String = buildString { +class SwitchClusterLongReleaseEvent(val previousPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterLongReleaseEvent {\n") append("\tpreviousPosition : $previousPosition\n") append("}\n") @@ -45,10 +40,10 @@ class SwitchClusterLongReleaseEvent ( companion object { private const val TAG_PREVIOUS_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterLongReleaseEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterLongReleaseEvent { tlvReader.enterStructure(tag) val previousPosition = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_POSITION)) - + tlvReader.exitContainer() return SwitchClusterLongReleaseEvent(previousPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt index 1e7eb6055668a6..81141e17424fbb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressCompleteEvent.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterMultiPressCompleteEvent ( - val previousPosition: Int, - val totalNumberOfPressesCounted: Int) { - override fun toString(): String = buildString { +class SwitchClusterMultiPressCompleteEvent( + val previousPosition: Int, + val totalNumberOfPressesCounted: Int +) { + override fun toString(): String = buildString { append("SwitchClusterMultiPressCompleteEvent {\n") append("\tpreviousPosition : $previousPosition\n") append("\ttotalNumberOfPressesCounted : $totalNumberOfPressesCounted\n") @@ -49,11 +46,12 @@ class SwitchClusterMultiPressCompleteEvent ( private const val TAG_PREVIOUS_POSITION = 0 private const val TAG_TOTAL_NUMBER_OF_PRESSES_COUNTED = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterMultiPressCompleteEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterMultiPressCompleteEvent { tlvReader.enterStructure(tag) val previousPosition = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_POSITION)) - val totalNumberOfPressesCounted = tlvReader.getInt(ContextSpecificTag(TAG_TOTAL_NUMBER_OF_PRESSES_COUNTED)) - + val totalNumberOfPressesCounted = + tlvReader.getInt(ContextSpecificTag(TAG_TOTAL_NUMBER_OF_PRESSES_COUNTED)) + tlvReader.exitContainer() return SwitchClusterMultiPressCompleteEvent(previousPosition, totalNumberOfPressesCounted) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt index 0500e314f696ef..11fab26fdfce8e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterMultiPressOngoingEvent.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterMultiPressOngoingEvent ( - val newPosition: Int, - val currentNumberOfPressesCounted: Int) { - override fun toString(): String = buildString { +class SwitchClusterMultiPressOngoingEvent( + val newPosition: Int, + val currentNumberOfPressesCounted: Int +) { + override fun toString(): String = buildString { append("SwitchClusterMultiPressOngoingEvent {\n") append("\tnewPosition : $newPosition\n") append("\tcurrentNumberOfPressesCounted : $currentNumberOfPressesCounted\n") @@ -49,11 +46,12 @@ class SwitchClusterMultiPressOngoingEvent ( private const val TAG_NEW_POSITION = 0 private const val TAG_CURRENT_NUMBER_OF_PRESSES_COUNTED = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterMultiPressOngoingEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterMultiPressOngoingEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - val currentNumberOfPressesCounted = tlvReader.getInt(ContextSpecificTag(TAG_CURRENT_NUMBER_OF_PRESSES_COUNTED)) - + val currentNumberOfPressesCounted = + tlvReader.getInt(ContextSpecificTag(TAG_CURRENT_NUMBER_OF_PRESSES_COUNTED)) + tlvReader.exitContainer() return SwitchClusterMultiPressOngoingEvent(newPosition, currentNumberOfPressesCounted) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt index 5d3e2f26c7fd0c..0eeb9e2841fd7c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterShortReleaseEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterShortReleaseEvent ( - val previousPosition: Int) { - override fun toString(): String = buildString { +class SwitchClusterShortReleaseEvent(val previousPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterShortReleaseEvent {\n") append("\tpreviousPosition : $previousPosition\n") append("}\n") @@ -45,10 +40,10 @@ class SwitchClusterShortReleaseEvent ( companion object { private const val TAG_PREVIOUS_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterShortReleaseEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterShortReleaseEvent { tlvReader.enterStructure(tag) val previousPosition = tlvReader.getInt(ContextSpecificTag(TAG_PREVIOUS_POSITION)) - + tlvReader.exitContainer() return SwitchClusterShortReleaseEvent(previousPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt index ec54e50aae31af..2b921b37ac6c2b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/SwitchClusterSwitchLatchedEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class SwitchClusterSwitchLatchedEvent ( - val newPosition: Int) { - override fun toString(): String = buildString { +class SwitchClusterSwitchLatchedEvent(val newPosition: Int) { + override fun toString(): String = buildString { append("SwitchClusterSwitchLatchedEvent {\n") append("\tnewPosition : $newPosition\n") append("}\n") @@ -45,10 +40,10 @@ class SwitchClusterSwitchLatchedEvent ( companion object { private const val TAG_NEW_POSITION = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SwitchClusterSwitchLatchedEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SwitchClusterSwitchLatchedEvent { tlvReader.enterStructure(tag) val newPosition = tlvReader.getInt(ContextSpecificTag(TAG_NEW_POSITION)) - + tlvReader.exitContainer() return SwitchClusterSwitchLatchedEvent(newPosition) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt index cca6b8f8499a17..ffdc72b1e54c89 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterConnectionStatusEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThreadNetworkDiagnosticsClusterConnectionStatusEvent ( - val connectionStatus: Int) { - override fun toString(): String = buildString { +class ThreadNetworkDiagnosticsClusterConnectionStatusEvent(val connectionStatus: Int) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterConnectionStatusEvent {\n") append("\tconnectionStatus : $connectionStatus\n") append("}\n") @@ -45,10 +40,13 @@ class ThreadNetworkDiagnosticsClusterConnectionStatusEvent ( companion object { private const val TAG_CONNECTION_STATUS = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterConnectionStatusEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): ThreadNetworkDiagnosticsClusterConnectionStatusEvent { tlvReader.enterStructure(tag) val connectionStatus = tlvReader.getInt(ContextSpecificTag(TAG_CONNECTION_STATUS)) - + tlvReader.exitContainer() return ThreadNetworkDiagnosticsClusterConnectionStatusEvent(connectionStatus) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt index ef103a4821a3e2..f9110c39fa1d40 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent.kt @@ -20,16 +20,14 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent( + val current: List, + val previous: List +) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +55,28 @@ class ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt index b66f227f0d07fe..53090f750b4e06 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterDSTStatusEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class TimeSynchronizationClusterDSTStatusEvent ( - val DSTOffsetActive: Boolean) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterDSTStatusEvent(val DSTOffsetActive: Boolean) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterDSTStatusEvent {\n") append("\tDSTOffsetActive : $DSTOffsetActive\n") append("}\n") @@ -45,10 +40,10 @@ class TimeSynchronizationClusterDSTStatusEvent ( companion object { private const val TAG_D_S_T_OFFSET_ACTIVE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterDSTStatusEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterDSTStatusEvent { tlvReader.enterStructure(tag) val DSTOffsetActive = tlvReader.getBoolean(ContextSpecificTag(TAG_D_S_T_OFFSET_ACTIVE)) - + tlvReader.exitContainer() return TimeSynchronizationClusterDSTStatusEvent(DSTOffsetActive) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt index 2ccb1685646258..452e9d902c4767 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/TimeSynchronizationClusterTimeZoneStatusEvent.kt @@ -17,19 +17,14 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class TimeSynchronizationClusterTimeZoneStatusEvent ( - val offset: Long, - val name: Optional) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterTimeZoneStatusEvent(val offset: Long, val name: Optional) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterTimeZoneStatusEvent {\n") append("\toffset : $offset\n") append("\tname : $name\n") @@ -41,9 +36,9 @@ class TimeSynchronizationClusterTimeZoneStatusEvent ( startStructure(tag) put(ContextSpecificTag(TAG_OFFSET), offset) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } endStructure() } } @@ -52,15 +47,16 @@ class TimeSynchronizationClusterTimeZoneStatusEvent ( private const val TAG_OFFSET = 0 private const val TAG_NAME = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterTimeZoneStatusEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterTimeZoneStatusEvent { tlvReader.enterStructure(tag) val offset = tlvReader.getLong(ContextSpecificTag(TAG_OFFSET)) - val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return TimeSynchronizationClusterTimeZoneStatusEvent(offset, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt index 1787e26580dba6..8c2e410ab80f6d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestEventEvent.kt @@ -20,20 +20,18 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterTestEventEvent ( - val arg1: Int, - val arg2: Int, - val arg3: Boolean, - val arg4: chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct, - val arg5: List, - val arg6: List) { - override fun toString(): String = buildString { +class UnitTestingClusterTestEventEvent( + val arg1: Int, + val arg2: Int, + val arg3: Boolean, + val arg4: chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct, + val arg5: List, + val arg6: List +) { + override fun toString(): String = buildString { append("UnitTestingClusterTestEventEvent {\n") append("\targ1 : $arg1\n") append("\targ2 : $arg2\n") @@ -73,27 +71,38 @@ class UnitTestingClusterTestEventEvent ( private const val TAG_ARG5 = 5 private const val TAG_ARG6 = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestEventEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestEventEvent { tlvReader.enterStructure(tag) val arg1 = tlvReader.getInt(ContextSpecificTag(TAG_ARG1)) val arg2 = tlvReader.getInt(ContextSpecificTag(TAG_ARG2)) val arg3 = tlvReader.getBoolean(ContextSpecificTag(TAG_ARG3)) - val arg4 = chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_ARG4), tlvReader) - val arg5 = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ARG5)) - while(!tlvReader.isEndOfContainer()) { - this.add(chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - val arg6 = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ARG6)) - while(!tlvReader.isEndOfContainer()) { - this.add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val arg4 = + chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv( + ContextSpecificTag(TAG_ARG4), + tlvReader + ) + val arg5 = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ARG5)) + while (!tlvReader.isEndOfContainer()) { + this.add( + chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct.fromTlv( + AnonymousTag, + tlvReader + ) + ) + } + tlvReader.exitContainer() + } + val arg6 = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ARG6)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return UnitTestingClusterTestEventEvent(arg1, arg2, arg3, arg4, arg5, arg6) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt index 1995cf80a3b1fc..d746c65d5ea1f1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/UnitTestingClusterTestFabricScopedEventEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterTestFabricScopedEventEvent ( - val fabricIndex: Int) { - override fun toString(): String = buildString { +class UnitTestingClusterTestFabricScopedEventEvent(val fabricIndex: Int) { + override fun toString(): String = buildString { append("UnitTestingClusterTestFabricScopedEventEvent {\n") append("\tfabricIndex : $fabricIndex\n") append("}\n") @@ -45,10 +40,10 @@ class UnitTestingClusterTestFabricScopedEventEvent ( companion object { private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestFabricScopedEventEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestFabricScopedEventEvent { tlvReader.enterStructure(tag) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return UnitTestingClusterTestFabricScopedEventEvent(fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt index 5db782d0005a54..087484ef1bfa7b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class WiFiNetworkDiagnosticsClusterAssociationFailureEvent ( - val associationFailure: Int, - val status: Int) { - override fun toString(): String = buildString { +class WiFiNetworkDiagnosticsClusterAssociationFailureEvent( + val associationFailure: Int, + val status: Int +) { + override fun toString(): String = buildString { append("WiFiNetworkDiagnosticsClusterAssociationFailureEvent {\n") append("\tassociationFailure : $associationFailure\n") append("\tstatus : $status\n") @@ -49,11 +46,14 @@ class WiFiNetworkDiagnosticsClusterAssociationFailureEvent ( private const val TAG_ASSOCIATION_FAILURE = 0 private const val TAG_STATUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : WiFiNetworkDiagnosticsClusterAssociationFailureEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): WiFiNetworkDiagnosticsClusterAssociationFailureEvent { tlvReader.enterStructure(tag) val associationFailure = tlvReader.getInt(ContextSpecificTag(TAG_ASSOCIATION_FAILURE)) val status = tlvReader.getInt(ContextSpecificTag(TAG_STATUS)) - + tlvReader.exitContainer() return WiFiNetworkDiagnosticsClusterAssociationFailureEvent(associationFailure, status) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt index 762339bde4f556..3599597c99b152 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class WiFiNetworkDiagnosticsClusterConnectionStatusEvent ( - val connectionStatus: Int) { - override fun toString(): String = buildString { +class WiFiNetworkDiagnosticsClusterConnectionStatusEvent(val connectionStatus: Int) { + override fun toString(): String = buildString { append("WiFiNetworkDiagnosticsClusterConnectionStatusEvent {\n") append("\tconnectionStatus : $connectionStatus\n") append("}\n") @@ -45,10 +40,13 @@ class WiFiNetworkDiagnosticsClusterConnectionStatusEvent ( companion object { private const val TAG_CONNECTION_STATUS = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : WiFiNetworkDiagnosticsClusterConnectionStatusEvent { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): WiFiNetworkDiagnosticsClusterConnectionStatusEvent { tlvReader.enterStructure(tag) val connectionStatus = tlvReader.getInt(ContextSpecificTag(TAG_CONNECTION_STATUS)) - + tlvReader.exitContainer() return WiFiNetworkDiagnosticsClusterConnectionStatusEvent(connectionStatus) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt index 2a702882f2557a..6d54ae4f2bfdcd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt @@ -17,18 +17,13 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class WiFiNetworkDiagnosticsClusterDisconnectionEvent ( - val reasonCode: Int) { - override fun toString(): String = buildString { +class WiFiNetworkDiagnosticsClusterDisconnectionEvent(val reasonCode: Int) { + override fun toString(): String = buildString { append("WiFiNetworkDiagnosticsClusterDisconnectionEvent {\n") append("\treasonCode : $reasonCode\n") append("}\n") @@ -45,10 +40,10 @@ class WiFiNetworkDiagnosticsClusterDisconnectionEvent ( companion object { private const val TAG_REASON_CODE = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : WiFiNetworkDiagnosticsClusterDisconnectionEvent { + fun fromTlv(tag: Tag, tlvReader: TlvReader): WiFiNetworkDiagnosticsClusterDisconnectionEvent { tlvReader.enterStructure(tag) val reasonCode = tlvReader.getInt(ContextSpecificTag(TAG_REASON_CODE)) - + tlvReader.exitContainer() return WiFiNetworkDiagnosticsClusterDisconnectionEvent(reasonCode) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt index a526275e085718..6daac4451c1833 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlEntryStruct.kt @@ -20,19 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class AccessControlClusterAccessControlEntryStruct ( - val privilege: Int, - val authMode: Int, - val subjects: List?, - val targets: List?, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class AccessControlClusterAccessControlEntryStruct( + val privilege: Int, + val authMode: Int, + val subjects: List?, + val targets: List?, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlEntryStruct {\n") append("\tprivilege : $privilege\n") append("\tauthMode : $authMode\n") @@ -48,23 +46,23 @@ class AccessControlClusterAccessControlEntryStruct ( put(ContextSpecificTag(TAG_PRIVILEGE), privilege) put(ContextSpecificTag(TAG_AUTH_MODE), authMode) if (subjects != null) { - startList(ContextSpecificTag(TAG_SUBJECTS)) - for (item in subjects.iterator()) { - put(AnonymousTag, item) + startList(ContextSpecificTag(TAG_SUBJECTS)) + for (item in subjects.iterator()) { + put(AnonymousTag, item) + } + endList() + } else { + putNull(ContextSpecificTag(TAG_SUBJECTS)) } - endList() - } else { - putNull(ContextSpecificTag(TAG_SUBJECTS)) - } if (targets != null) { - startList(ContextSpecificTag(TAG_TARGETS)) - for (item in targets.iterator()) { - item.toTlv(AnonymousTag, this) + startList(ContextSpecificTag(TAG_TARGETS)) + for (item in targets.iterator()) { + item.toTlv(AnonymousTag, this) + } + endList() + } else { + putNull(ContextSpecificTag(TAG_TARGETS)) } - endList() - } else { - putNull(ContextSpecificTag(TAG_TARGETS)) - } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -77,39 +75,47 @@ class AccessControlClusterAccessControlEntryStruct ( private const val TAG_TARGETS = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlEntryStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): AccessControlClusterAccessControlEntryStruct { tlvReader.enterStructure(tag) val privilege = tlvReader.getInt(ContextSpecificTag(TAG_PRIVILEGE)) val authMode = tlvReader.getInt(ContextSpecificTag(TAG_AUTH_MODE)) - val subjects = if (!tlvReader.isNull()) { - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_SUBJECTS)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getLong(AnonymousTag)) - } - tlvReader.exitContainer() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_SUBJECTS)) - null - } - val targets = if (!tlvReader.isNull()) { - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_TARGETS)) - while(!tlvReader.isEndOfContainer()) { - add(AccessControlClusterAccessControlTargetStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_TARGETS)) - null - } + val subjects = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_SUBJECTS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getLong(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_SUBJECTS)) + null + } + val targets = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_TARGETS)) + while (!tlvReader.isEndOfContainer()) { + add(AccessControlClusterAccessControlTargetStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_TARGETS)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return AccessControlClusterAccessControlEntryStruct(privilege, authMode, subjects, targets, fabricIndex) + return AccessControlClusterAccessControlEntryStruct( + privilege, + authMode, + subjects, + targets, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt index 9b832daa283b9f..4a1d95221d816c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlExtensionStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class AccessControlClusterAccessControlExtensionStruct ( - val data: ByteArray, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class AccessControlClusterAccessControlExtensionStruct(val data: ByteArray, val fabricIndex: Int) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlExtensionStruct {\n") append("\tdata : $data\n") append("\tfabricIndex : $fabricIndex\n") @@ -49,11 +43,11 @@ class AccessControlClusterAccessControlExtensionStruct ( private const val TAG_DATA = 1 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlExtensionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): AccessControlClusterAccessControlExtensionStruct { tlvReader.enterStructure(tag) val data = tlvReader.getByteArray(ContextSpecificTag(TAG_DATA)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return AccessControlClusterAccessControlExtensionStruct(data, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt index 8070aecfe241b5..e721aa3fefe91d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AccessControlClusterAccessControlTargetStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class AccessControlClusterAccessControlTargetStruct ( - val cluster: Long?, - val endpoint: Int?, - val deviceType: Long?) { - override fun toString(): String = buildString { +class AccessControlClusterAccessControlTargetStruct( + val cluster: Long?, + val endpoint: Int?, + val deviceType: Long? +) { + override fun toString(): String = buildString { append("AccessControlClusterAccessControlTargetStruct {\n") append("\tcluster : $cluster\n") append("\tendpoint : $endpoint\n") @@ -42,20 +39,20 @@ class AccessControlClusterAccessControlTargetStruct ( tlvWriter.apply { startStructure(tag) if (cluster != null) { - put(ContextSpecificTag(TAG_CLUSTER), cluster) - } else { - putNull(ContextSpecificTag(TAG_CLUSTER)) - } + put(ContextSpecificTag(TAG_CLUSTER), cluster) + } else { + putNull(ContextSpecificTag(TAG_CLUSTER)) + } if (endpoint != null) { - put(ContextSpecificTag(TAG_ENDPOINT), endpoint) - } else { - putNull(ContextSpecificTag(TAG_ENDPOINT)) - } + put(ContextSpecificTag(TAG_ENDPOINT), endpoint) + } else { + putNull(ContextSpecificTag(TAG_ENDPOINT)) + } if (deviceType != null) { - put(ContextSpecificTag(TAG_DEVICE_TYPE), deviceType) - } else { - putNull(ContextSpecificTag(TAG_DEVICE_TYPE)) - } + put(ContextSpecificTag(TAG_DEVICE_TYPE), deviceType) + } else { + putNull(ContextSpecificTag(TAG_DEVICE_TYPE)) + } endStructure() } } @@ -65,27 +62,30 @@ class AccessControlClusterAccessControlTargetStruct ( private const val TAG_ENDPOINT = 1 private const val TAG_DEVICE_TYPE = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : AccessControlClusterAccessControlTargetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): AccessControlClusterAccessControlTargetStruct { tlvReader.enterStructure(tag) - val cluster = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_CLUSTER)) - null - } - val endpoint = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ENDPOINT)) - null - } - val deviceType = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_DEVICE_TYPE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_DEVICE_TYPE)) - null - } - + val cluster = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_CLUSTER)) + null + } + val endpoint = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ENDPOINT)) + null + } + val deviceType = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_DEVICE_TYPE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_DEVICE_TYPE)) + null + } + tlvReader.exitContainer() return AccessControlClusterAccessControlTargetStruct(cluster, endpoint, deviceType) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt index 9dc8c67a270df1..2ed7a3f08152be 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterActionStruct.kt @@ -17,23 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ActionsClusterActionStruct ( - val actionID: Int, - val name: String, - val type: Int, - val endpointListID: Int, - val supportedCommands: Int, - val state: Int) { - override fun toString(): String = buildString { +class ActionsClusterActionStruct( + val actionID: Int, + val name: String, + val type: Int, + val endpointListID: Int, + val supportedCommands: Int, + val state: Int +) { + override fun toString(): String = buildString { append("ActionsClusterActionStruct {\n") append("\tactionID : $actionID\n") append("\tname : $name\n") @@ -65,7 +62,7 @@ class ActionsClusterActionStruct ( private const val TAG_SUPPORTED_COMMANDS = 4 private const val TAG_STATE = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterActionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterActionStruct { tlvReader.enterStructure(tag) val actionID = tlvReader.getInt(ContextSpecificTag(TAG_ACTION_I_D)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) @@ -73,10 +70,17 @@ class ActionsClusterActionStruct ( val endpointListID = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT_LIST_I_D)) val supportedCommands = tlvReader.getInt(ContextSpecificTag(TAG_SUPPORTED_COMMANDS)) val state = tlvReader.getInt(ContextSpecificTag(TAG_STATE)) - + tlvReader.exitContainer() - return ActionsClusterActionStruct(actionID, name, type, endpointListID, supportedCommands, state) + return ActionsClusterActionStruct( + actionID, + name, + type, + endpointListID, + supportedCommands, + state + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt index 5d46b079c5e9bf..b714e693156957 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActionsClusterEndpointListStruct.kt @@ -20,18 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ActionsClusterEndpointListStruct ( - val endpointListID: Int, - val name: String, - val type: Int, - val endpoints: List) { - override fun toString(): String = buildString { +class ActionsClusterEndpointListStruct( + val endpointListID: Int, + val name: String, + val type: Int, + val endpoints: List +) { + override fun toString(): String = buildString { append("ActionsClusterEndpointListStruct {\n") append("\tendpointListID : $endpointListID\n") append("\tname : $name\n") @@ -61,19 +59,20 @@ class ActionsClusterEndpointListStruct ( private const val TAG_TYPE = 2 private const val TAG_ENDPOINTS = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActionsClusterEndpointListStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ActionsClusterEndpointListStruct { tlvReader.enterStructure(tag) val endpointListID = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT_LIST_I_D)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val type = tlvReader.getInt(ContextSpecificTag(TAG_TYPE)) - val endpoints = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val endpoints = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ActionsClusterEndpointListStruct(endpointListID, name, type, endpoints) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt index f4f298dadf0fcc..68a44d37dfff0f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ActivatedCarbonFilterMonitoringClusterReplacementProductStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ActivatedCarbonFilterMonitoringClusterReplacementProductStruct ( - val productIdentifierType: Int, - val productIdentifierValue: String) { - override fun toString(): String = buildString { +class ActivatedCarbonFilterMonitoringClusterReplacementProductStruct( + val productIdentifierType: Int, + val productIdentifierValue: String +) { + override fun toString(): String = buildString { append("ActivatedCarbonFilterMonitoringClusterReplacementProductStruct {\n") append("\tproductIdentifierType : $productIdentifierType\n") append("\tproductIdentifierValue : $productIdentifierValue\n") @@ -49,14 +46,21 @@ class ActivatedCarbonFilterMonitoringClusterReplacementProductStruct ( private const val TAG_PRODUCT_IDENTIFIER_TYPE = 0 private const val TAG_PRODUCT_IDENTIFIER_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ActivatedCarbonFilterMonitoringClusterReplacementProductStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): ActivatedCarbonFilterMonitoringClusterReplacementProductStruct { tlvReader.enterStructure(tag) val productIdentifierType = tlvReader.getInt(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_TYPE)) - val productIdentifierValue = tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) - + val productIdentifierValue = + tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) + tlvReader.exitContainer() - return ActivatedCarbonFilterMonitoringClusterReplacementProductStruct(productIdentifierType, productIdentifierValue) + return ActivatedCarbonFilterMonitoringClusterReplacementProductStruct( + productIdentifierType, + productIdentifierValue + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt index aa1effe8df43cd..21649a8ecc73df 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationBasicClusterApplicationStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ApplicationBasicClusterApplicationStruct ( - val catalogVendorID: Int, - val applicationID: String) { - override fun toString(): String = buildString { +class ApplicationBasicClusterApplicationStruct( + val catalogVendorID: Int, + val applicationID: String +) { + override fun toString(): String = buildString { append("ApplicationBasicClusterApplicationStruct {\n") append("\tcatalogVendorID : $catalogVendorID\n") append("\tapplicationID : $applicationID\n") @@ -49,11 +46,11 @@ class ApplicationBasicClusterApplicationStruct ( private const val TAG_CATALOG_VENDOR_I_D = 0 private const val TAG_APPLICATION_I_D = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ApplicationBasicClusterApplicationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ApplicationBasicClusterApplicationStruct { tlvReader.enterStructure(tag) val catalogVendorID = tlvReader.getInt(ContextSpecificTag(TAG_CATALOG_VENDOR_I_D)) val applicationID = tlvReader.getString(ContextSpecificTag(TAG_APPLICATION_I_D)) - + tlvReader.exitContainer() return ApplicationBasicClusterApplicationStruct(catalogVendorID, applicationID) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt index cf701fb6c1a094..f710204737cb52 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationEPStruct.kt @@ -17,19 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class ApplicationLauncherClusterApplicationEPStruct ( - val application: ApplicationLauncherClusterApplicationStruct, - val endpoint: Optional) { - override fun toString(): String = buildString { +class ApplicationLauncherClusterApplicationEPStruct( + val application: ApplicationLauncherClusterApplicationStruct, + val endpoint: Optional +) { + override fun toString(): String = buildString { append("ApplicationLauncherClusterApplicationEPStruct {\n") append("\tapplication : $application\n") append("\tendpoint : $endpoint\n") @@ -41,9 +39,9 @@ class ApplicationLauncherClusterApplicationEPStruct ( startStructure(tag) application.toTlv(ContextSpecificTag(TAG_APPLICATION), this) if (endpoint.isPresent) { - val optendpoint = endpoint.get() - put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) - } + val optendpoint = endpoint.get() + put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) + } endStructure() } } @@ -52,15 +50,20 @@ class ApplicationLauncherClusterApplicationEPStruct ( private const val TAG_APPLICATION = 0 private const val TAG_ENDPOINT = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ApplicationLauncherClusterApplicationEPStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ApplicationLauncherClusterApplicationEPStruct { tlvReader.enterStructure(tag) - val application = ApplicationLauncherClusterApplicationStruct.fromTlv(ContextSpecificTag(TAG_APPLICATION), tlvReader) - val endpoint = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) - } else { - Optional.empty() - } - + val application = + ApplicationLauncherClusterApplicationStruct.fromTlv( + ContextSpecificTag(TAG_APPLICATION), + tlvReader + ) + val endpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return ApplicationLauncherClusterApplicationEPStruct(application, endpoint) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt index b9b7f772372d19..68e78e31084c04 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ApplicationLauncherClusterApplicationStruct ( - val catalogVendorID: Int, - val applicationID: String) { - override fun toString(): String = buildString { +class ApplicationLauncherClusterApplicationStruct( + val catalogVendorID: Int, + val applicationID: String +) { + override fun toString(): String = buildString { append("ApplicationLauncherClusterApplicationStruct {\n") append("\tcatalogVendorID : $catalogVendorID\n") append("\tapplicationID : $applicationID\n") @@ -49,11 +46,11 @@ class ApplicationLauncherClusterApplicationStruct ( private const val TAG_CATALOG_VENDOR_I_D = 0 private const val TAG_APPLICATION_I_D = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ApplicationLauncherClusterApplicationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ApplicationLauncherClusterApplicationStruct { tlvReader.enterStructure(tag) val catalogVendorID = tlvReader.getInt(ContextSpecificTag(TAG_CATALOG_VENDOR_I_D)) val applicationID = tlvReader.getString(ContextSpecificTag(TAG_APPLICATION_I_D)) - + tlvReader.exitContainer() return ApplicationLauncherClusterApplicationStruct(catalogVendorID, applicationID) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt index 028781fa7acfb5..aef8596f19a83c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt @@ -17,20 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class AudioOutputClusterOutputInfoStruct ( - val index: Int, - val outputType: Int, - val name: String) { - override fun toString(): String = buildString { +class AudioOutputClusterOutputInfoStruct(val index: Int, val outputType: Int, val name: String) { + override fun toString(): String = buildString { append("AudioOutputClusterOutputInfoStruct {\n") append("\tindex : $index\n") append("\toutputType : $outputType\n") @@ -53,12 +46,12 @@ class AudioOutputClusterOutputInfoStruct ( private const val TAG_OUTPUT_TYPE = 1 private const val TAG_NAME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : AudioOutputClusterOutputInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): AudioOutputClusterOutputInfoStruct { tlvReader.enterStructure(tag) val index = tlvReader.getInt(ContextSpecificTag(TAG_INDEX)) val outputType = tlvReader.getInt(ContextSpecificTag(TAG_OUTPUT_TYPE)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) - + tlvReader.exitContainer() return AudioOutputClusterOutputInfoStruct(index, outputType, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt index 8a58e9a242ed40..e4f323b6321541 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BasicInformationClusterCapabilityMinimaStruct ( - val caseSessionsPerFabric: Int, - val subscriptionsPerFabric: Int) { - override fun toString(): String = buildString { +class BasicInformationClusterCapabilityMinimaStruct( + val caseSessionsPerFabric: Int, + val subscriptionsPerFabric: Int +) { + override fun toString(): String = buildString { append("BasicInformationClusterCapabilityMinimaStruct {\n") append("\tcaseSessionsPerFabric : $caseSessionsPerFabric\n") append("\tsubscriptionsPerFabric : $subscriptionsPerFabric\n") @@ -49,14 +46,18 @@ class BasicInformationClusterCapabilityMinimaStruct ( private const val TAG_CASE_SESSIONS_PER_FABRIC = 0 private const val TAG_SUBSCRIPTIONS_PER_FABRIC = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterCapabilityMinimaStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterCapabilityMinimaStruct { tlvReader.enterStructure(tag) val caseSessionsPerFabric = tlvReader.getInt(ContextSpecificTag(TAG_CASE_SESSIONS_PER_FABRIC)) - val subscriptionsPerFabric = tlvReader.getInt(ContextSpecificTag(TAG_SUBSCRIPTIONS_PER_FABRIC)) - + val subscriptionsPerFabric = + tlvReader.getInt(ContextSpecificTag(TAG_SUBSCRIPTIONS_PER_FABRIC)) + tlvReader.exitContainer() - return BasicInformationClusterCapabilityMinimaStruct(caseSessionsPerFabric, subscriptionsPerFabric) + return BasicInformationClusterCapabilityMinimaStruct( + caseSessionsPerFabric, + subscriptionsPerFabric + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt index e01685c44e3566..3678494c7b90fb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BasicInformationClusterProductAppearanceStruct ( - val finish: Int, - val primaryColor: Int?) { - override fun toString(): String = buildString { +class BasicInformationClusterProductAppearanceStruct(val finish: Int, val primaryColor: Int?) { + override fun toString(): String = buildString { append("BasicInformationClusterProductAppearanceStruct {\n") append("\tfinish : $finish\n") append("\tprimaryColor : $primaryColor\n") @@ -41,10 +35,10 @@ class BasicInformationClusterProductAppearanceStruct ( startStructure(tag) put(ContextSpecificTag(TAG_FINISH), finish) if (primaryColor != null) { - put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) - } else { - putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } + put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) + } else { + putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } endStructure() } } @@ -53,16 +47,17 @@ class BasicInformationClusterProductAppearanceStruct ( private const val TAG_FINISH = 0 private const val TAG_PRIMARY_COLOR = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BasicInformationClusterProductAppearanceStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BasicInformationClusterProductAppearanceStruct { tlvReader.enterStructure(tag) val finish = tlvReader.getInt(ContextSpecificTag(TAG_FINISH)) - val primaryColor = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - null - } - + val primaryColor = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + null + } + tlvReader.exitContainer() return BasicInformationClusterProductAppearanceStruct(finish, primaryColor) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt index 861ebbd1875f58..8ab0146b8e95f3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt @@ -17,22 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class BindingClusterTargetStruct ( - val node: Optional, - val group: Optional, - val endpoint: Optional, - val cluster: Optional, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class BindingClusterTargetStruct( + val node: Optional, + val group: Optional, + val endpoint: Optional, + val cluster: Optional, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("BindingClusterTargetStruct {\n") append("\tnode : $node\n") append("\tgroup : $group\n") @@ -46,21 +44,21 @@ class BindingClusterTargetStruct ( tlvWriter.apply { startStructure(tag) if (node.isPresent) { - val optnode = node.get() - put(ContextSpecificTag(TAG_NODE), optnode) - } + val optnode = node.get() + put(ContextSpecificTag(TAG_NODE), optnode) + } if (group.isPresent) { - val optgroup = group.get() - put(ContextSpecificTag(TAG_GROUP), optgroup) - } + val optgroup = group.get() + put(ContextSpecificTag(TAG_GROUP), optgroup) + } if (endpoint.isPresent) { - val optendpoint = endpoint.get() - put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) - } + val optendpoint = endpoint.get() + put(ContextSpecificTag(TAG_ENDPOINT), optendpoint) + } if (cluster.isPresent) { - val optcluster = cluster.get() - put(ContextSpecificTag(TAG_CLUSTER), optcluster) - } + val optcluster = cluster.get() + put(ContextSpecificTag(TAG_CLUSTER), optcluster) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -73,30 +71,34 @@ class BindingClusterTargetStruct ( private const val TAG_CLUSTER = 4 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BindingClusterTargetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): BindingClusterTargetStruct { tlvReader.enterStructure(tag) - val node = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NODE))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_NODE))) - } else { - Optional.empty() - } - val group = if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_GROUP))) - } else { - Optional.empty() - } - val endpoint = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) - } else { - Optional.empty() - } - val cluster = if (tlvReader.isNextTag(ContextSpecificTag(TAG_CLUSTER))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER))) - } else { - Optional.empty() - } + val node = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NODE))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_NODE))) + } else { + Optional.empty() + } + val group = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_GROUP))) + } else { + Optional.empty() + } + val endpoint = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ENDPOINT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT))) + } else { + Optional.empty() + } + val cluster = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CLUSTER))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER))) + } else { + Optional.empty() + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return BindingClusterTargetStruct(node, group, endpoint, cluster, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt index 778935a86e9455..d1426bc0828631 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class BridgedDeviceBasicInformationClusterProductAppearanceStruct ( - val finish: Int, - val primaryColor: Int?) { - override fun toString(): String = buildString { +class BridgedDeviceBasicInformationClusterProductAppearanceStruct( + val finish: Int, + val primaryColor: Int? +) { + override fun toString(): String = buildString { append("BridgedDeviceBasicInformationClusterProductAppearanceStruct {\n") append("\tfinish : $finish\n") append("\tprimaryColor : $primaryColor\n") @@ -41,10 +38,10 @@ class BridgedDeviceBasicInformationClusterProductAppearanceStruct ( startStructure(tag) put(ContextSpecificTag(TAG_FINISH), finish) if (primaryColor != null) { - put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) - } else { - putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } + put(ContextSpecificTag(TAG_PRIMARY_COLOR), primaryColor) + } else { + putNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } endStructure() } } @@ -53,16 +50,20 @@ class BridgedDeviceBasicInformationClusterProductAppearanceStruct ( private const val TAG_FINISH = 0 private const val TAG_PRIMARY_COLOR = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : BridgedDeviceBasicInformationClusterProductAppearanceStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): BridgedDeviceBasicInformationClusterProductAppearanceStruct { tlvReader.enterStructure(tag) val finish = tlvReader.getInt(ContextSpecificTag(TAG_FINISH)) - val primaryColor = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) - null - } - + val primaryColor = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_PRIMARY_COLOR)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_PRIMARY_COLOR)) + null + } + tlvReader.exitContainer() return BridgedDeviceBasicInformationClusterProductAppearanceStruct(finish, primaryColor) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt index acfddff56c75cb..9d10bf6f24e5fa 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt @@ -17,22 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class ChannelClusterChannelInfoStruct ( - val majorNumber: Int, - val minorNumber: Int, - val name: Optional, - val callSign: Optional, - val affiliateCallSign: Optional) { - override fun toString(): String = buildString { +class ChannelClusterChannelInfoStruct( + val majorNumber: Int, + val minorNumber: Int, + val name: Optional, + val callSign: Optional, + val affiliateCallSign: Optional +) { + override fun toString(): String = buildString { append("ChannelClusterChannelInfoStruct {\n") append("\tmajorNumber : $majorNumber\n") append("\tminorNumber : $minorNumber\n") @@ -48,17 +46,17 @@ class ChannelClusterChannelInfoStruct ( put(ContextSpecificTag(TAG_MAJOR_NUMBER), majorNumber) put(ContextSpecificTag(TAG_MINOR_NUMBER), minorNumber) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } if (callSign.isPresent) { - val optcallSign = callSign.get() - put(ContextSpecificTag(TAG_CALL_SIGN), optcallSign) - } + val optcallSign = callSign.get() + put(ContextSpecificTag(TAG_CALL_SIGN), optcallSign) + } if (affiliateCallSign.isPresent) { - val optaffiliateCallSign = affiliateCallSign.get() - put(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN), optaffiliateCallSign) - } + val optaffiliateCallSign = affiliateCallSign.get() + put(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN), optaffiliateCallSign) + } endStructure() } } @@ -70,29 +68,38 @@ class ChannelClusterChannelInfoStruct ( private const val TAG_CALL_SIGN = 3 private const val TAG_AFFILIATE_CALL_SIGN = 4 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ChannelClusterChannelInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ChannelClusterChannelInfoStruct { tlvReader.enterStructure(tag) val majorNumber = tlvReader.getInt(ContextSpecificTag(TAG_MAJOR_NUMBER)) val minorNumber = tlvReader.getInt(ContextSpecificTag(TAG_MINOR_NUMBER)) - val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - val callSign = if (tlvReader.isNextTag(ContextSpecificTag(TAG_CALL_SIGN))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CALL_SIGN))) - } else { - Optional.empty() - } - val affiliateCallSign = if (tlvReader.isNextTag(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) - } else { - Optional.empty() - } - + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val callSign = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CALL_SIGN))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CALL_SIGN))) + } else { + Optional.empty() + } + val affiliateCallSign = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_AFFILIATE_CALL_SIGN))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return ChannelClusterChannelInfoStruct(majorNumber, minorNumber, name, callSign, affiliateCallSign) + return ChannelClusterChannelInfoStruct( + majorNumber, + minorNumber, + name, + callSign, + affiliateCallSign + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt index 0010ae68479954..edc8f9157db120 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterLineupInfoStruct.kt @@ -17,21 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class ChannelClusterLineupInfoStruct ( - val operatorName: String, - val lineupName: Optional, - val postalCode: Optional, - val lineupInfoType: Int) { - override fun toString(): String = buildString { +class ChannelClusterLineupInfoStruct( + val operatorName: String, + val lineupName: Optional, + val postalCode: Optional, + val lineupInfoType: Int +) { + override fun toString(): String = buildString { append("ChannelClusterLineupInfoStruct {\n") append("\toperatorName : $operatorName\n") append("\tlineupName : $lineupName\n") @@ -45,13 +43,13 @@ class ChannelClusterLineupInfoStruct ( startStructure(tag) put(ContextSpecificTag(TAG_OPERATOR_NAME), operatorName) if (lineupName.isPresent) { - val optlineupName = lineupName.get() - put(ContextSpecificTag(TAG_LINEUP_NAME), optlineupName) - } + val optlineupName = lineupName.get() + put(ContextSpecificTag(TAG_LINEUP_NAME), optlineupName) + } if (postalCode.isPresent) { - val optpostalCode = postalCode.get() - put(ContextSpecificTag(TAG_POSTAL_CODE), optpostalCode) - } + val optpostalCode = postalCode.get() + put(ContextSpecificTag(TAG_POSTAL_CODE), optpostalCode) + } put(ContextSpecificTag(TAG_LINEUP_INFO_TYPE), lineupInfoType) endStructure() } @@ -63,21 +61,23 @@ class ChannelClusterLineupInfoStruct ( private const val TAG_POSTAL_CODE = 2 private const val TAG_LINEUP_INFO_TYPE = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ChannelClusterLineupInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ChannelClusterLineupInfoStruct { tlvReader.enterStructure(tag) val operatorName = tlvReader.getString(ContextSpecificTag(TAG_OPERATOR_NAME)) - val lineupName = if (tlvReader.isNextTag(ContextSpecificTag(TAG_LINEUP_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LINEUP_NAME))) - } else { - Optional.empty() - } - val postalCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_POSTAL_CODE))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_POSTAL_CODE))) - } else { - Optional.empty() - } + val lineupName = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_LINEUP_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LINEUP_NAME))) + } else { + Optional.empty() + } + val postalCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_POSTAL_CODE))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_POSTAL_CODE))) + } else { + Optional.empty() + } val lineupInfoType = tlvReader.getInt(ContextSpecificTag(TAG_LINEUP_INFO_TYPE)) - + tlvReader.exitContainer() return ChannelClusterLineupInfoStruct(operatorName, lineupName, postalCode, lineupInfoType) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt index 0e54edff044225..0e1ebee9f97df2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ContentLauncherClusterAdditionalInfoStruct ( - val name: String, - val value: String) { - override fun toString(): String = buildString { +class ContentLauncherClusterAdditionalInfoStruct(val name: String, val value: String) { + override fun toString(): String = buildString { append("ContentLauncherClusterAdditionalInfoStruct {\n") append("\tname : $name\n") append("\tvalue : $value\n") @@ -49,11 +43,11 @@ class ContentLauncherClusterAdditionalInfoStruct ( private const val TAG_NAME = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterAdditionalInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterAdditionalInfoStruct { tlvReader.enterStructure(tag) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return ContentLauncherClusterAdditionalInfoStruct(name, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt index 993719fc427de5..5f4719e9c00ef8 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt @@ -17,23 +17,21 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class ContentLauncherClusterBrandingInformationStruct ( - val providerName: String, - val background: Optional, - val logo: Optional, - val progressBar: Optional, - val splash: Optional, - val waterMark: Optional) { - override fun toString(): String = buildString { +class ContentLauncherClusterBrandingInformationStruct( + val providerName: String, + val background: Optional, + val logo: Optional, + val progressBar: Optional, + val splash: Optional, + val waterMark: Optional +) { + override fun toString(): String = buildString { append("ContentLauncherClusterBrandingInformationStruct {\n") append("\tproviderName : $providerName\n") append("\tbackground : $background\n") @@ -49,25 +47,25 @@ class ContentLauncherClusterBrandingInformationStruct ( startStructure(tag) put(ContextSpecificTag(TAG_PROVIDER_NAME), providerName) if (background.isPresent) { - val optbackground = background.get() - optbackground.toTlv(ContextSpecificTag(TAG_BACKGROUND), this) - } + val optbackground = background.get() + optbackground.toTlv(ContextSpecificTag(TAG_BACKGROUND), this) + } if (logo.isPresent) { - val optlogo = logo.get() - optlogo.toTlv(ContextSpecificTag(TAG_LOGO), this) - } + val optlogo = logo.get() + optlogo.toTlv(ContextSpecificTag(TAG_LOGO), this) + } if (progressBar.isPresent) { - val optprogressBar = progressBar.get() - optprogressBar.toTlv(ContextSpecificTag(TAG_PROGRESS_BAR), this) - } + val optprogressBar = progressBar.get() + optprogressBar.toTlv(ContextSpecificTag(TAG_PROGRESS_BAR), this) + } if (splash.isPresent) { - val optsplash = splash.get() - optsplash.toTlv(ContextSpecificTag(TAG_SPLASH), this) - } + val optsplash = splash.get() + optsplash.toTlv(ContextSpecificTag(TAG_SPLASH), this) + } if (waterMark.isPresent) { - val optwaterMark = waterMark.get() - optwaterMark.toTlv(ContextSpecificTag(TAG_WATER_MARK), this) - } + val optwaterMark = waterMark.get() + optwaterMark.toTlv(ContextSpecificTag(TAG_WATER_MARK), this) + } endStructure() } } @@ -80,38 +78,75 @@ class ContentLauncherClusterBrandingInformationStruct ( private const val TAG_SPLASH = 4 private const val TAG_WATER_MARK = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterBrandingInformationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterBrandingInformationStruct { tlvReader.enterStructure(tag) val providerName = tlvReader.getString(ContextSpecificTag(TAG_PROVIDER_NAME)) - val background = if (tlvReader.isNextTag(ContextSpecificTag(TAG_BACKGROUND))) { - Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_BACKGROUND), tlvReader)) - } else { - Optional.empty() - } - val logo = if (tlvReader.isNextTag(ContextSpecificTag(TAG_LOGO))) { - Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_LOGO), tlvReader)) - } else { - Optional.empty() - } - val progressBar = if (tlvReader.isNextTag(ContextSpecificTag(TAG_PROGRESS_BAR))) { - Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_PROGRESS_BAR), tlvReader)) - } else { - Optional.empty() - } - val splash = if (tlvReader.isNextTag(ContextSpecificTag(TAG_SPLASH))) { - Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_SPLASH), tlvReader)) - } else { - Optional.empty() - } - val waterMark = if (tlvReader.isNextTag(ContextSpecificTag(TAG_WATER_MARK))) { - Optional.of(ContentLauncherClusterStyleInformationStruct.fromTlv(ContextSpecificTag(TAG_WATER_MARK), tlvReader)) - } else { - Optional.empty() - } - + val background = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BACKGROUND))) { + Optional.of( + ContentLauncherClusterStyleInformationStruct.fromTlv( + ContextSpecificTag(TAG_BACKGROUND), + tlvReader + ) + ) + } else { + Optional.empty() + } + val logo = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_LOGO))) { + Optional.of( + ContentLauncherClusterStyleInformationStruct.fromTlv( + ContextSpecificTag(TAG_LOGO), + tlvReader + ) + ) + } else { + Optional.empty() + } + val progressBar = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_PROGRESS_BAR))) { + Optional.of( + ContentLauncherClusterStyleInformationStruct.fromTlv( + ContextSpecificTag(TAG_PROGRESS_BAR), + tlvReader + ) + ) + } else { + Optional.empty() + } + val splash = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SPLASH))) { + Optional.of( + ContentLauncherClusterStyleInformationStruct.fromTlv( + ContextSpecificTag(TAG_SPLASH), + tlvReader + ) + ) + } else { + Optional.empty() + } + val waterMark = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_WATER_MARK))) { + Optional.of( + ContentLauncherClusterStyleInformationStruct.fromTlv( + ContextSpecificTag(TAG_WATER_MARK), + tlvReader + ) + ) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return ContentLauncherClusterBrandingInformationStruct(providerName, background, logo, progressBar, splash, waterMark) + return ContentLauncherClusterBrandingInformationStruct( + providerName, + background, + logo, + progressBar, + splash, + waterMark + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt index b3b713ba8e8079..9457b03907a4fb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterContentSearchStruct.kt @@ -20,15 +20,13 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ContentLauncherClusterContentSearchStruct ( - val parameterList: List) { - override fun toString(): String = buildString { +class ContentLauncherClusterContentSearchStruct( + val parameterList: List +) { + override fun toString(): String = buildString { append("ContentLauncherClusterContentSearchStruct {\n") append("\tparameterList : $parameterList\n") append("}\n") @@ -49,16 +47,17 @@ class ContentLauncherClusterContentSearchStruct ( companion object { private const val TAG_PARAMETER_LIST = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterContentSearchStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterContentSearchStruct { tlvReader.enterStructure(tag) - val parameterList = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PARAMETER_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(ContentLauncherClusterParameterStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val parameterList = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PARAMETER_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ContentLauncherClusterParameterStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ContentLauncherClusterContentSearchStruct(parameterList) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt index 2bf3ed85bae436..a38245918bb476 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterDimensionStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ContentLauncherClusterDimensionStruct ( - val width: Double, - val height: Double, - val metric: Int) { - override fun toString(): String = buildString { +class ContentLauncherClusterDimensionStruct( + val width: Double, + val height: Double, + val metric: Int +) { + override fun toString(): String = buildString { append("ContentLauncherClusterDimensionStruct {\n") append("\twidth : $width\n") append("\theight : $height\n") @@ -53,12 +50,12 @@ class ContentLauncherClusterDimensionStruct ( private const val TAG_HEIGHT = 1 private const val TAG_METRIC = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterDimensionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterDimensionStruct { tlvReader.enterStructure(tag) val width = tlvReader.getDouble(ContextSpecificTag(TAG_WIDTH)) val height = tlvReader.getDouble(ContextSpecificTag(TAG_HEIGHT)) val metric = tlvReader.getInt(ContextSpecificTag(TAG_METRIC)) - + tlvReader.exitContainer() return ContentLauncherClusterDimensionStruct(width, height, metric) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt index 19f4e650b0615b..caf0f99848c93c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterParameterStruct.kt @@ -20,17 +20,16 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class ContentLauncherClusterParameterStruct ( - val type: Int, - val value: String, - val externalIDList: Optional>) { - override fun toString(): String = buildString { +class ContentLauncherClusterParameterStruct( + val type: Int, + val value: String, + val externalIDList: Optional> +) { + override fun toString(): String = buildString { append("ContentLauncherClusterParameterStruct {\n") append("\ttype : $type\n") append("\tvalue : $value\n") @@ -44,13 +43,13 @@ class ContentLauncherClusterParameterStruct ( put(ContextSpecificTag(TAG_TYPE), type) put(ContextSpecificTag(TAG_VALUE), value) if (externalIDList.isPresent) { - val optexternalIDList = externalIDList.get() - startList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) - for (item in optexternalIDList.iterator()) { - item.toTlv(AnonymousTag, this) + val optexternalIDList = externalIDList.get() + startList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + for (item in optexternalIDList.iterator()) { + item.toTlv(AnonymousTag, this) + } + endList() } - endList() - } endStructure() } } @@ -60,22 +59,25 @@ class ContentLauncherClusterParameterStruct ( private const val TAG_VALUE = 1 private const val TAG_EXTERNAL_I_D_LIST = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterParameterStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterParameterStruct { tlvReader.enterStructure(tag) val type = tlvReader.getInt(ContextSpecificTag(TAG_TYPE)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - val externalIDList = if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST))) { - Optional.of(buildList { - tlvReader.enterList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(ContentLauncherClusterAdditionalInfoStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - }) - } else { - Optional.empty() - } - + val externalIDList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST))) { + Optional.of( + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_EXTERNAL_I_D_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ContentLauncherClusterAdditionalInfoStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + tlvReader.exitContainer() return ContentLauncherClusterParameterStruct(type, value, externalIDList) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt index b9f2044614dd71..d5e686bbb5ac45 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterStyleInformationStruct.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class ContentLauncherClusterStyleInformationStruct ( - val imageURL: Optional, - val color: Optional, - val size: Optional) { - override fun toString(): String = buildString { +class ContentLauncherClusterStyleInformationStruct( + val imageURL: Optional, + val color: Optional, + val size: Optional +) { + override fun toString(): String = buildString { append("ContentLauncherClusterStyleInformationStruct {\n") append("\timageURL : $imageURL\n") append("\tcolor : $color\n") @@ -42,17 +40,17 @@ class ContentLauncherClusterStyleInformationStruct ( tlvWriter.apply { startStructure(tag) if (imageURL.isPresent) { - val optimageURL = imageURL.get() - put(ContextSpecificTag(TAG_IMAGE_U_R_L), optimageURL) - } + val optimageURL = imageURL.get() + put(ContextSpecificTag(TAG_IMAGE_U_R_L), optimageURL) + } if (color.isPresent) { - val optcolor = color.get() - put(ContextSpecificTag(TAG_COLOR), optcolor) - } + val optcolor = color.get() + put(ContextSpecificTag(TAG_COLOR), optcolor) + } if (size.isPresent) { - val optsize = size.get() - optsize.toTlv(ContextSpecificTag(TAG_SIZE), this) - } + val optsize = size.get() + optsize.toTlv(ContextSpecificTag(TAG_SIZE), this) + } endStructure() } } @@ -62,24 +60,29 @@ class ContentLauncherClusterStyleInformationStruct ( private const val TAG_COLOR = 1 private const val TAG_SIZE = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ContentLauncherClusterStyleInformationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ContentLauncherClusterStyleInformationStruct { tlvReader.enterStructure(tag) - val imageURL = if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_U_R_L))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_IMAGE_U_R_L))) - } else { - Optional.empty() - } - val color = if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) - } else { - Optional.empty() - } - val size = if (tlvReader.isNextTag(ContextSpecificTag(TAG_SIZE))) { - Optional.of(ContentLauncherClusterDimensionStruct.fromTlv(ContextSpecificTag(TAG_SIZE), tlvReader)) - } else { - Optional.empty() - } - + val imageURL = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_U_R_L))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_IMAGE_U_R_L))) + } else { + Optional.empty() + } + val color = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) + } else { + Optional.empty() + } + val size = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SIZE))) { + Optional.of( + ContentLauncherClusterDimensionStruct.fromTlv(ContextSpecificTag(TAG_SIZE), tlvReader) + ) + } else { + Optional.empty() + } + tlvReader.exitContainer() return ContentLauncherClusterStyleInformationStruct(imageURL, color, size) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt index d76de77105ded9..75fed36957e726 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterDeviceTypeStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DescriptorClusterDeviceTypeStruct ( - val deviceType: Long, - val revision: Int) { - override fun toString(): String = buildString { +class DescriptorClusterDeviceTypeStruct(val deviceType: Long, val revision: Int) { + override fun toString(): String = buildString { append("DescriptorClusterDeviceTypeStruct {\n") append("\tdeviceType : $deviceType\n") append("\trevision : $revision\n") @@ -49,11 +43,11 @@ class DescriptorClusterDeviceTypeStruct ( private const val TAG_DEVICE_TYPE = 0 private const val TAG_REVISION = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DescriptorClusterDeviceTypeStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DescriptorClusterDeviceTypeStruct { tlvReader.enterStructure(tag) val deviceType = tlvReader.getLong(ContextSpecificTag(TAG_DEVICE_TYPE)) val revision = tlvReader.getInt(ContextSpecificTag(TAG_REVISION)) - + tlvReader.exitContainer() return DescriptorClusterDeviceTypeStruct(deviceType, revision) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt index 8c5fc527b8a5e5..abde881ccffcea 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DescriptorClusterSemanticTagStruct.kt @@ -17,21 +17,19 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class DescriptorClusterSemanticTagStruct ( - val mfgCode: Int?, - val namespaceID: Int, - val tag: Int, - val label: Optional?) { - override fun toString(): String = buildString { +class DescriptorClusterSemanticTagStruct( + val mfgCode: Int?, + val namespaceID: Int, + val tag: Int, + val label: Optional? +) { + override fun toString(): String = buildString { append("DescriptorClusterSemanticTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tnamespaceID : $namespaceID\n") @@ -44,20 +42,20 @@ class DescriptorClusterSemanticTagStruct ( tlvWriter.apply { startStructure(tag) if (mfgCode != null) { - put(ContextSpecificTag(TAG_MFG_CODE), mfgCode) - } else { - putNull(ContextSpecificTag(TAG_MFG_CODE)) - } + put(ContextSpecificTag(TAG_MFG_CODE), mfgCode) + } else { + putNull(ContextSpecificTag(TAG_MFG_CODE)) + } put(ContextSpecificTag(TAG_NAMESPACE_I_D), namespaceID) put(ContextSpecificTag(TAG_TAG), tag) if (label != null) { - if (label.isPresent) { - val optlabel = label.get() - put(ContextSpecificTag(TAG_LABEL), optlabel) - } - } else { - putNull(ContextSpecificTag(TAG_LABEL)) - } + if (label.isPresent) { + val optlabel = label.get() + put(ContextSpecificTag(TAG_LABEL), optlabel) + } + } else { + putNull(ContextSpecificTag(TAG_LABEL)) + } endStructure() } } @@ -68,27 +66,29 @@ class DescriptorClusterSemanticTagStruct ( private const val TAG_TAG = 2 private const val TAG_LABEL = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DescriptorClusterSemanticTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DescriptorClusterSemanticTagStruct { tlvReader.enterStructure(tag) - val mfgCode = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_MFG_CODE)) - null - } + val mfgCode = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MFG_CODE)) + null + } val namespaceID = tlvReader.getInt(ContextSpecificTag(TAG_NAMESPACE_I_D)) val tag = tlvReader.getInt(ContextSpecificTag(TAG_TAG)) - val label = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LABEL))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LABEL)) - null - } - + val label = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_LABEL))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LABEL)) + null + } + tlvReader.exitContainer() return DescriptorClusterSemanticTagStruct(mfgCode, namespaceID, tag, label) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt index d7004fbfc53590..423d6a554672ce 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeOptionStruct.kt @@ -20,17 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DishwasherModeClusterModeOptionStruct ( - val label: String, - val mode: Int, - val modeTags: List) { - override fun toString(): String = buildString { +class DishwasherModeClusterModeOptionStruct( + val label: String, + val mode: Int, + val modeTags: List +) { + override fun toString(): String = buildString { append("DishwasherModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -57,18 +55,19 @@ class DishwasherModeClusterModeOptionStruct ( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DishwasherModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DishwasherModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while(!tlvReader.isEndOfContainer()) { - add(DishwasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while (!tlvReader.isEndOfContainer()) { + add(DishwasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return DishwasherModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt index 110964c9ed2cf6..33881f4ac00c8d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DishwasherModeClusterModeTagStruct.kt @@ -17,19 +17,14 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class DishwasherModeClusterModeTagStruct ( - val mfgCode: Optional, - val value: Int) { - override fun toString(): String = buildString { +class DishwasherModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { + override fun toString(): String = buildString { append("DishwasherModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -40,9 +35,9 @@ class DishwasherModeClusterModeTagStruct ( tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -52,15 +47,16 @@ class DishwasherModeClusterModeTagStruct ( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DishwasherModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DishwasherModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return DishwasherModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt index de3654516fc946..da3a551267eb09 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/DoorLockClusterCredentialStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class DoorLockClusterCredentialStruct ( - val credentialType: Int, - val credentialIndex: Int) { - override fun toString(): String = buildString { +class DoorLockClusterCredentialStruct(val credentialType: Int, val credentialIndex: Int) { + override fun toString(): String = buildString { append("DoorLockClusterCredentialStruct {\n") append("\tcredentialType : $credentialType\n") append("\tcredentialIndex : $credentialIndex\n") @@ -49,11 +43,11 @@ class DoorLockClusterCredentialStruct ( private const val TAG_CREDENTIAL_TYPE = 0 private const val TAG_CREDENTIAL_INDEX = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : DoorLockClusterCredentialStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): DoorLockClusterCredentialStruct { tlvReader.enterStructure(tag) val credentialType = tlvReader.getInt(ContextSpecificTag(TAG_CREDENTIAL_TYPE)) val credentialIndex = tlvReader.getInt(ContextSpecificTag(TAG_CREDENTIAL_INDEX)) - + tlvReader.exitContainer() return DoorLockClusterCredentialStruct(credentialType, credentialIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt index 16567ccab1ce30..09292f726d9467 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/FixedLabelClusterLabelStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class FixedLabelClusterLabelStruct ( - val label: String, - val value: String) { - override fun toString(): String = buildString { +class FixedLabelClusterLabelStruct(val label: String, val value: String) { + override fun toString(): String = buildString { append("FixedLabelClusterLabelStruct {\n") append("\tlabel : $label\n") append("\tvalue : $value\n") @@ -49,11 +43,11 @@ class FixedLabelClusterLabelStruct ( private const val TAG_LABEL = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : FixedLabelClusterLabelStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): FixedLabelClusterLabelStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return FixedLabelClusterLabelStruct(label, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt index 2153c5ea32fc7d..60d10b41112a9d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralCommissioningClusterBasicCommissioningInfo.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GeneralCommissioningClusterBasicCommissioningInfo ( - val failSafeExpiryLengthSeconds: Int, - val maxCumulativeFailsafeSeconds: Int) { - override fun toString(): String = buildString { +class GeneralCommissioningClusterBasicCommissioningInfo( + val failSafeExpiryLengthSeconds: Int, + val maxCumulativeFailsafeSeconds: Int +) { + override fun toString(): String = buildString { append("GeneralCommissioningClusterBasicCommissioningInfo {\n") append("\tfailSafeExpiryLengthSeconds : $failSafeExpiryLengthSeconds\n") append("\tmaxCumulativeFailsafeSeconds : $maxCumulativeFailsafeSeconds\n") @@ -49,14 +46,19 @@ class GeneralCommissioningClusterBasicCommissioningInfo ( private const val TAG_FAIL_SAFE_EXPIRY_LENGTH_SECONDS = 0 private const val TAG_MAX_CUMULATIVE_FAILSAFE_SECONDS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralCommissioningClusterBasicCommissioningInfo { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralCommissioningClusterBasicCommissioningInfo { tlvReader.enterStructure(tag) - val failSafeExpiryLengthSeconds = tlvReader.getInt(ContextSpecificTag(TAG_FAIL_SAFE_EXPIRY_LENGTH_SECONDS)) - val maxCumulativeFailsafeSeconds = tlvReader.getInt(ContextSpecificTag(TAG_MAX_CUMULATIVE_FAILSAFE_SECONDS)) - + val failSafeExpiryLengthSeconds = + tlvReader.getInt(ContextSpecificTag(TAG_FAIL_SAFE_EXPIRY_LENGTH_SECONDS)) + val maxCumulativeFailsafeSeconds = + tlvReader.getInt(ContextSpecificTag(TAG_MAX_CUMULATIVE_FAILSAFE_SECONDS)) + tlvReader.exitContainer() - return GeneralCommissioningClusterBasicCommissioningInfo(failSafeExpiryLengthSeconds, maxCumulativeFailsafeSeconds) + return GeneralCommissioningClusterBasicCommissioningInfo( + failSafeExpiryLengthSeconds, + maxCumulativeFailsafeSeconds + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt index 2813b085912e48..d4ff313520e65e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GeneralDiagnosticsClusterNetworkInterface.kt @@ -20,22 +20,20 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GeneralDiagnosticsClusterNetworkInterface ( - val name: String, - val isOperational: Boolean, - val offPremiseServicesReachableIPv4: Boolean?, - val offPremiseServicesReachableIPv6: Boolean?, - val hardwareAddress: ByteArray, - val IPv4Addresses: List, - val IPv6Addresses: List, - val type: Int) { - override fun toString(): String = buildString { +class GeneralDiagnosticsClusterNetworkInterface( + val name: String, + val isOperational: Boolean, + val offPremiseServicesReachableIPv4: Boolean?, + val offPremiseServicesReachableIPv6: Boolean?, + val hardwareAddress: ByteArray, + val IPv4Addresses: List, + val IPv6Addresses: List, + val type: Int +) { + override fun toString(): String = buildString { append("GeneralDiagnosticsClusterNetworkInterface {\n") append("\tname : $name\n") append("\tisOperational : $isOperational\n") @@ -54,15 +52,21 @@ class GeneralDiagnosticsClusterNetworkInterface ( put(ContextSpecificTag(TAG_NAME), name) put(ContextSpecificTag(TAG_IS_OPERATIONAL), isOperational) if (offPremiseServicesReachableIPv4 != null) { - put(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4), offPremiseServicesReachableIPv4) - } else { - putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) - } + put( + ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4), + offPremiseServicesReachableIPv4 + ) + } else { + putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) + } if (offPremiseServicesReachableIPv6 != null) { - put(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6), offPremiseServicesReachableIPv6) - } else { - putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) - } + put( + ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6), + offPremiseServicesReachableIPv6 + ) + } else { + putNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) + } put(ContextSpecificTag(TAG_HARDWARE_ADDRESS), hardwareAddress) startList(ContextSpecificTag(TAG_I_PV4_ADDRESSES)) for (item in IPv4Addresses.iterator()) { @@ -89,42 +93,55 @@ class GeneralDiagnosticsClusterNetworkInterface ( private const val TAG_I_PV6_ADDRESSES = 6 private const val TAG_TYPE = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GeneralDiagnosticsClusterNetworkInterface { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GeneralDiagnosticsClusterNetworkInterface { tlvReader.enterStructure(tag) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val isOperational = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_OPERATIONAL)) - val offPremiseServicesReachableIPv4 = if (!tlvReader.isNull()) { - tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) - null - } - val offPremiseServicesReachableIPv6 = if (!tlvReader.isNull()) { - tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) - null - } + val offPremiseServicesReachableIPv4 = + if (!tlvReader.isNull()) { + tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV4)) + null + } + val offPremiseServicesReachableIPv6 = + if (!tlvReader.isNull()) { + tlvReader.getBoolean(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_OFF_PREMISE_SERVICES_REACHABLE_I_PV6)) + null + } val hardwareAddress = tlvReader.getByteArray(ContextSpecificTag(TAG_HARDWARE_ADDRESS)) - val IPv4Addresses = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_I_PV4_ADDRESSES)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getByteArray(AnonymousTag)) - } - tlvReader.exitContainer() - } - val IPv6Addresses = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_I_PV6_ADDRESSES)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getByteArray(AnonymousTag)) - } - tlvReader.exitContainer() - } + val IPv4Addresses = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_I_PV4_ADDRESSES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getByteArray(AnonymousTag)) + } + tlvReader.exitContainer() + } + val IPv6Addresses = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_I_PV6_ADDRESSES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getByteArray(AnonymousTag)) + } + tlvReader.exitContainer() + } val type = tlvReader.getInt(ContextSpecificTag(TAG_TYPE)) - + tlvReader.exitContainer() - return GeneralDiagnosticsClusterNetworkInterface(name, isOperational, offPremiseServicesReachableIPv4, offPremiseServicesReachableIPv6, hardwareAddress, IPv4Addresses, IPv6Addresses, type) + return GeneralDiagnosticsClusterNetworkInterface( + name, + isOperational, + offPremiseServicesReachableIPv4, + offPremiseServicesReachableIPv6, + hardwareAddress, + IPv4Addresses, + IPv6Addresses, + type + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt index c6ecaa9eb20014..6038b55d345b75 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupInfoMapStruct.kt @@ -20,18 +20,17 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class GroupKeyManagementClusterGroupInfoMapStruct ( - val groupId: Int, - val endpoints: List, - val groupName: Optional, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class GroupKeyManagementClusterGroupInfoMapStruct( + val groupId: Int, + val endpoints: List, + val groupName: Optional, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("GroupKeyManagementClusterGroupInfoMapStruct {\n") append("\tgroupId : $groupId\n") append("\tendpoints : $endpoints\n") @@ -50,9 +49,9 @@ class GroupKeyManagementClusterGroupInfoMapStruct ( } endList() if (groupName.isPresent) { - val optgroupName = groupName.get() - put(ContextSpecificTag(TAG_GROUP_NAME), optgroupName) - } + val optgroupName = groupName.get() + put(ContextSpecificTag(TAG_GROUP_NAME), optgroupName) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -64,23 +63,25 @@ class GroupKeyManagementClusterGroupInfoMapStruct ( private const val TAG_GROUP_NAME = 3 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GroupKeyManagementClusterGroupInfoMapStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GroupKeyManagementClusterGroupInfoMapStruct { tlvReader.enterStructure(tag) val groupId = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_ID)) - val endpoints = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val groupName = if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_GROUP_NAME))) - } else { - Optional.empty() - } + val endpoints = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ENDPOINTS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val groupName = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_GROUP_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_GROUP_NAME))) + } else { + Optional.empty() + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return GroupKeyManagementClusterGroupInfoMapStruct(groupId, endpoints, groupName, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt index 8e692ad743b3c1..d565d70233abc2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeyMapStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GroupKeyManagementClusterGroupKeyMapStruct ( - val groupId: Int, - val groupKeySetID: Int, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class GroupKeyManagementClusterGroupKeyMapStruct( + val groupId: Int, + val groupKeySetID: Int, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("GroupKeyManagementClusterGroupKeyMapStruct {\n") append("\tgroupId : $groupId\n") append("\tgroupKeySetID : $groupKeySetID\n") @@ -53,12 +50,12 @@ class GroupKeyManagementClusterGroupKeyMapStruct ( private const val TAG_GROUP_KEY_SET_I_D = 2 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GroupKeyManagementClusterGroupKeyMapStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GroupKeyManagementClusterGroupKeyMapStruct { tlvReader.enterStructure(tag) val groupId = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_ID)) val groupKeySetID = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SET_I_D)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return GroupKeyManagementClusterGroupKeyMapStruct(groupId, groupKeySetID, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt index 0af577bdf3cdce..418b6037ae46c9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/GroupKeyManagementClusterGroupKeySetStruct.kt @@ -17,25 +17,22 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class GroupKeyManagementClusterGroupKeySetStruct ( - val groupKeySetID: Int, - val groupKeySecurityPolicy: Int, - val epochKey0: ByteArray?, - val epochStartTime0: Long?, - val epochKey1: ByteArray?, - val epochStartTime1: Long?, - val epochKey2: ByteArray?, - val epochStartTime2: Long?) { - override fun toString(): String = buildString { +class GroupKeyManagementClusterGroupKeySetStruct( + val groupKeySetID: Int, + val groupKeySecurityPolicy: Int, + val epochKey0: ByteArray?, + val epochStartTime0: Long?, + val epochKey1: ByteArray?, + val epochStartTime1: Long?, + val epochKey2: ByteArray?, + val epochStartTime2: Long? +) { + override fun toString(): String = buildString { append("GroupKeyManagementClusterGroupKeySetStruct {\n") append("\tgroupKeySetID : $groupKeySetID\n") append("\tgroupKeySecurityPolicy : $groupKeySecurityPolicy\n") @@ -54,35 +51,35 @@ class GroupKeyManagementClusterGroupKeySetStruct ( put(ContextSpecificTag(TAG_GROUP_KEY_SET_I_D), groupKeySetID) put(ContextSpecificTag(TAG_GROUP_KEY_SECURITY_POLICY), groupKeySecurityPolicy) if (epochKey0 != null) { - put(ContextSpecificTag(TAG_EPOCH_KEY0), epochKey0) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_KEY0)) - } + put(ContextSpecificTag(TAG_EPOCH_KEY0), epochKey0) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_KEY0)) + } if (epochStartTime0 != null) { - put(ContextSpecificTag(TAG_EPOCH_START_TIME0), epochStartTime0) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) - } + put(ContextSpecificTag(TAG_EPOCH_START_TIME0), epochStartTime0) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) + } if (epochKey1 != null) { - put(ContextSpecificTag(TAG_EPOCH_KEY1), epochKey1) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_KEY1)) - } + put(ContextSpecificTag(TAG_EPOCH_KEY1), epochKey1) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_KEY1)) + } if (epochStartTime1 != null) { - put(ContextSpecificTag(TAG_EPOCH_START_TIME1), epochStartTime1) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) - } + put(ContextSpecificTag(TAG_EPOCH_START_TIME1), epochStartTime1) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) + } if (epochKey2 != null) { - put(ContextSpecificTag(TAG_EPOCH_KEY2), epochKey2) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_KEY2)) - } + put(ContextSpecificTag(TAG_EPOCH_KEY2), epochKey2) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_KEY2)) + } if (epochStartTime2 != null) { - put(ContextSpecificTag(TAG_EPOCH_START_TIME2), epochStartTime2) - } else { - putNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) - } + put(ContextSpecificTag(TAG_EPOCH_START_TIME2), epochStartTime2) + } else { + putNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) + } endStructure() } } @@ -97,50 +94,66 @@ class GroupKeyManagementClusterGroupKeySetStruct ( private const val TAG_EPOCH_KEY2 = 6 private const val TAG_EPOCH_START_TIME2 = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : GroupKeyManagementClusterGroupKeySetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): GroupKeyManagementClusterGroupKeySetStruct { tlvReader.enterStructure(tag) val groupKeySetID = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SET_I_D)) - val groupKeySecurityPolicy = tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SECURITY_POLICY)) - val epochKey0 = if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY0)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY0)) - null - } - val epochStartTime0 = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME0)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) - null - } - val epochKey1 = if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY1)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY1)) - null - } - val epochStartTime1 = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME1)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) - null - } - val epochKey2 = if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY2)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY2)) - null - } - val epochStartTime2 = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME2)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) - null - } - + val groupKeySecurityPolicy = + tlvReader.getInt(ContextSpecificTag(TAG_GROUP_KEY_SECURITY_POLICY)) + val epochKey0 = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY0)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY0)) + null + } + val epochStartTime0 = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME0)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME0)) + null + } + val epochKey1 = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY1)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY1)) + null + } + val epochStartTime1 = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME1)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME1)) + null + } + val epochKey2 = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_EPOCH_KEY2)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_KEY2)) + null + } + val epochStartTime2 = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_EPOCH_START_TIME2)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_EPOCH_START_TIME2)) + null + } + tlvReader.exitContainer() - return GroupKeyManagementClusterGroupKeySetStruct(groupKeySetID, groupKeySecurityPolicy, epochKey0, epochStartTime0, epochKey1, epochStartTime1, epochKey2, epochStartTime2) + return GroupKeyManagementClusterGroupKeySetStruct( + groupKeySetID, + groupKeySecurityPolicy, + epochKey0, + epochStartTime0, + epochKey1, + epochStartTime1, + epochKey2, + epochStartTime2 + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt index 9ecba7669d8e6f..a86ba8db2dee0a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/HepaFilterMonitoringClusterReplacementProductStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class HepaFilterMonitoringClusterReplacementProductStruct ( - val productIdentifierType: Int, - val productIdentifierValue: String) { - override fun toString(): String = buildString { +class HepaFilterMonitoringClusterReplacementProductStruct( + val productIdentifierType: Int, + val productIdentifierValue: String +) { + override fun toString(): String = buildString { append("HepaFilterMonitoringClusterReplacementProductStruct {\n") append("\tproductIdentifierType : $productIdentifierType\n") append("\tproductIdentifierValue : $productIdentifierValue\n") @@ -49,14 +46,21 @@ class HepaFilterMonitoringClusterReplacementProductStruct ( private const val TAG_PRODUCT_IDENTIFIER_TYPE = 0 private const val TAG_PRODUCT_IDENTIFIER_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : HepaFilterMonitoringClusterReplacementProductStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): HepaFilterMonitoringClusterReplacementProductStruct { tlvReader.enterStructure(tag) val productIdentifierType = tlvReader.getInt(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_TYPE)) - val productIdentifierValue = tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) - + val productIdentifierValue = + tlvReader.getString(ContextSpecificTag(TAG_PRODUCT_IDENTIFIER_VALUE)) + tlvReader.exitContainer() - return HepaFilterMonitoringClusterReplacementProductStruct(productIdentifierType, productIdentifierValue) + return HepaFilterMonitoringClusterReplacementProductStruct( + productIdentifierType, + productIdentifierValue + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt index ebef1ce2ce74a7..d380689bed016f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/IcdManagementClusterMonitoringRegistrationStruct.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class IcdManagementClusterMonitoringRegistrationStruct ( - val checkInNodeID: Long, - val monitoredSubject: Long, - val key: ByteArray, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class IcdManagementClusterMonitoringRegistrationStruct( + val checkInNodeID: Long, + val monitoredSubject: Long, + val key: ByteArray, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("IcdManagementClusterMonitoringRegistrationStruct {\n") append("\tcheckInNodeID : $checkInNodeID\n") append("\tmonitoredSubject : $monitoredSubject\n") @@ -57,16 +54,21 @@ class IcdManagementClusterMonitoringRegistrationStruct ( private const val TAG_KEY = 3 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : IcdManagementClusterMonitoringRegistrationStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): IcdManagementClusterMonitoringRegistrationStruct { tlvReader.enterStructure(tag) val checkInNodeID = tlvReader.getLong(ContextSpecificTag(TAG_CHECK_IN_NODE_I_D)) val monitoredSubject = tlvReader.getLong(ContextSpecificTag(TAG_MONITORED_SUBJECT)) val key = tlvReader.getByteArray(ContextSpecificTag(TAG_KEY)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return IcdManagementClusterMonitoringRegistrationStruct(checkInNodeID, monitoredSubject, key, fabricIndex) + return IcdManagementClusterMonitoringRegistrationStruct( + checkInNodeID, + monitoredSubject, + key, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt index 91f733b2bf8edd..eeab9e95eb7cce 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeOptionStruct.kt @@ -20,17 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class LaundryWasherModeClusterModeOptionStruct ( - val label: String, - val mode: Int, - val modeTags: List) { - override fun toString(): String = buildString { +class LaundryWasherModeClusterModeOptionStruct( + val label: String, + val mode: Int, + val modeTags: List +) { + override fun toString(): String = buildString { append("LaundryWasherModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -57,18 +55,19 @@ class LaundryWasherModeClusterModeOptionStruct ( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : LaundryWasherModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): LaundryWasherModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while(!tlvReader.isEndOfContainer()) { - add(LaundryWasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while (!tlvReader.isEndOfContainer()) { + add(LaundryWasherModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return LaundryWasherModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt index 06685de8506c7d..eed09912c26a9c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/LaundryWasherModeClusterModeTagStruct.kt @@ -17,19 +17,14 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class LaundryWasherModeClusterModeTagStruct ( - val mfgCode: Optional, - val value: Int) { - override fun toString(): String = buildString { +class LaundryWasherModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { + override fun toString(): String = buildString { append("LaundryWasherModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -40,9 +35,9 @@ class LaundryWasherModeClusterModeTagStruct ( tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -52,15 +47,16 @@ class LaundryWasherModeClusterModeTagStruct ( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : LaundryWasherModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): LaundryWasherModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return LaundryWasherModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt index 7be50d0dbc9ad3..514c05d19f6fdf 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaInputClusterInputInfoStruct.kt @@ -17,21 +17,18 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class MediaInputClusterInputInfoStruct ( - val index: Int, - val inputType: Int, - val name: String, - val description: String) { - override fun toString(): String = buildString { +class MediaInputClusterInputInfoStruct( + val index: Int, + val inputType: Int, + val name: String, + val description: String +) { + override fun toString(): String = buildString { append("MediaInputClusterInputInfoStruct {\n") append("\tindex : $index\n") append("\tinputType : $inputType\n") @@ -57,13 +54,13 @@ class MediaInputClusterInputInfoStruct ( private const val TAG_NAME = 2 private const val TAG_DESCRIPTION = 3 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : MediaInputClusterInputInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): MediaInputClusterInputInfoStruct { tlvReader.enterStructure(tag) val index = tlvReader.getInt(ContextSpecificTag(TAG_INDEX)) val inputType = tlvReader.getInt(ContextSpecificTag(TAG_INPUT_TYPE)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) val description = tlvReader.getString(ContextSpecificTag(TAG_DESCRIPTION)) - + tlvReader.exitContainer() return MediaInputClusterInputInfoStruct(index, inputType, name, description) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt index 6b6e8cfcf12403..d452d083a73112 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/MediaPlaybackClusterPlaybackPositionStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class MediaPlaybackClusterPlaybackPositionStruct ( - val updatedAt: Long, - val position: Long?) { - override fun toString(): String = buildString { +class MediaPlaybackClusterPlaybackPositionStruct(val updatedAt: Long, val position: Long?) { + override fun toString(): String = buildString { append("MediaPlaybackClusterPlaybackPositionStruct {\n") append("\tupdatedAt : $updatedAt\n") append("\tposition : $position\n") @@ -41,10 +35,10 @@ class MediaPlaybackClusterPlaybackPositionStruct ( startStructure(tag) put(ContextSpecificTag(TAG_UPDATED_AT), updatedAt) if (position != null) { - put(ContextSpecificTag(TAG_POSITION), position) - } else { - putNull(ContextSpecificTag(TAG_POSITION)) - } + put(ContextSpecificTag(TAG_POSITION), position) + } else { + putNull(ContextSpecificTag(TAG_POSITION)) + } endStructure() } } @@ -53,16 +47,17 @@ class MediaPlaybackClusterPlaybackPositionStruct ( private const val TAG_UPDATED_AT = 0 private const val TAG_POSITION = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : MediaPlaybackClusterPlaybackPositionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): MediaPlaybackClusterPlaybackPositionStruct { tlvReader.enterStructure(tag) val updatedAt = tlvReader.getLong(ContextSpecificTag(TAG_UPDATED_AT)) - val position = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_POSITION)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_POSITION)) - null - } - + val position = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_POSITION)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_POSITION)) + null + } + tlvReader.exitContainer() return MediaPlaybackClusterPlaybackPositionStruct(updatedAt, position) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt index eacbd43215cc6c..ac95817519112f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterModeOptionStruct.kt @@ -20,17 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ModeSelectClusterModeOptionStruct ( - val label: String, - val mode: Int, - val semanticTags: List) { - override fun toString(): String = buildString { +class ModeSelectClusterModeOptionStruct( + val label: String, + val mode: Int, + val semanticTags: List +) { + override fun toString(): String = buildString { append("ModeSelectClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -57,18 +55,19 @@ class ModeSelectClusterModeOptionStruct ( private const val TAG_MODE = 1 private const val TAG_SEMANTIC_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ModeSelectClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ModeSelectClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val semanticTags = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_SEMANTIC_TAGS)) - while(!tlvReader.isEndOfContainer()) { - add(ModeSelectClusterSemanticTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val semanticTags = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_SEMANTIC_TAGS)) + while (!tlvReader.isEndOfContainer()) { + add(ModeSelectClusterSemanticTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ModeSelectClusterModeOptionStruct(label, mode, semanticTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt index 6e00f596b61ebf..04c893671659d3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ModeSelectClusterSemanticTagStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ModeSelectClusterSemanticTagStruct ( - val mfgCode: Int, - val value: Int) { - override fun toString(): String = buildString { +class ModeSelectClusterSemanticTagStruct(val mfgCode: Int, val value: Int) { + override fun toString(): String = buildString { append("ModeSelectClusterSemanticTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -49,11 +43,11 @@ class ModeSelectClusterSemanticTagStruct ( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ModeSelectClusterSemanticTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ModeSelectClusterSemanticTagStruct { tlvReader.enterStructure(tag) val mfgCode = tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE)) val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return ModeSelectClusterSemanticTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt index 9cf40b7e7ce7a3..8b942f2a492dd1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterNetworkInfoStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class NetworkCommissioningClusterNetworkInfoStruct ( - val networkID: ByteArray, - val connected: Boolean) { - override fun toString(): String = buildString { +class NetworkCommissioningClusterNetworkInfoStruct( + val networkID: ByteArray, + val connected: Boolean +) { + override fun toString(): String = buildString { append("NetworkCommissioningClusterNetworkInfoStruct {\n") append("\tnetworkID : $networkID\n") append("\tconnected : $connected\n") @@ -49,11 +46,11 @@ class NetworkCommissioningClusterNetworkInfoStruct ( private const val TAG_NETWORK_I_D = 0 private const val TAG_CONNECTED = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : NetworkCommissioningClusterNetworkInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): NetworkCommissioningClusterNetworkInfoStruct { tlvReader.enterStructure(tag) val networkID = tlvReader.getByteArray(ContextSpecificTag(TAG_NETWORK_I_D)) val connected = tlvReader.getBoolean(ContextSpecificTag(TAG_CONNECTED)) - + tlvReader.exitContainer() return NetworkCommissioningClusterNetworkInfoStruct(networkID, connected) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt index e8cc5c1941d7d8..76593b32131477 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterThreadInterfaceScanResultStruct.kt @@ -17,25 +17,22 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class NetworkCommissioningClusterThreadInterfaceScanResultStruct ( - val panId: Int, - val extendedPanId: Long, - val networkName: String, - val channel: Int, - val version: Int, - val extendedAddress: ByteArray, - val rssi: Int, - val lqi: Int) { - override fun toString(): String = buildString { +class NetworkCommissioningClusterThreadInterfaceScanResultStruct( + val panId: Int, + val extendedPanId: Long, + val networkName: String, + val channel: Int, + val version: Int, + val extendedAddress: ByteArray, + val rssi: Int, + val lqi: Int +) { + override fun toString(): String = buildString { append("NetworkCommissioningClusterThreadInterfaceScanResultStruct {\n") append("\tpanId : $panId\n") append("\textendedPanId : $extendedPanId\n") @@ -73,7 +70,10 @@ class NetworkCommissioningClusterThreadInterfaceScanResultStruct ( private const val TAG_RSSI = 6 private const val TAG_LQI = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : NetworkCommissioningClusterThreadInterfaceScanResultStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): NetworkCommissioningClusterThreadInterfaceScanResultStruct { tlvReader.enterStructure(tag) val panId = tlvReader.getInt(ContextSpecificTag(TAG_PAN_ID)) val extendedPanId = tlvReader.getLong(ContextSpecificTag(TAG_EXTENDED_PAN_ID)) @@ -83,10 +83,19 @@ class NetworkCommissioningClusterThreadInterfaceScanResultStruct ( val extendedAddress = tlvReader.getByteArray(ContextSpecificTag(TAG_EXTENDED_ADDRESS)) val rssi = tlvReader.getInt(ContextSpecificTag(TAG_RSSI)) val lqi = tlvReader.getInt(ContextSpecificTag(TAG_LQI)) - + tlvReader.exitContainer() - return NetworkCommissioningClusterThreadInterfaceScanResultStruct(panId, extendedPanId, networkName, channel, version, extendedAddress, rssi, lqi) + return NetworkCommissioningClusterThreadInterfaceScanResultStruct( + panId, + extendedPanId, + networkName, + channel, + version, + extendedAddress, + rssi, + lqi + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt index efcd50f0c17fba..d2cf4bcf5b7cb0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/NetworkCommissioningClusterWiFiInterfaceScanResultStruct.kt @@ -17,23 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class NetworkCommissioningClusterWiFiInterfaceScanResultStruct ( - val security: Int, - val ssid: ByteArray, - val bssid: ByteArray, - val channel: Int, - val wiFiBand: Int, - val rssi: Int) { - override fun toString(): String = buildString { +class NetworkCommissioningClusterWiFiInterfaceScanResultStruct( + val security: Int, + val ssid: ByteArray, + val bssid: ByteArray, + val channel: Int, + val wiFiBand: Int, + val rssi: Int +) { + override fun toString(): String = buildString { append("NetworkCommissioningClusterWiFiInterfaceScanResultStruct {\n") append("\tsecurity : $security\n") append("\tssid : $ssid\n") @@ -65,7 +62,10 @@ class NetworkCommissioningClusterWiFiInterfaceScanResultStruct ( private const val TAG_WI_FI_BAND = 4 private const val TAG_RSSI = 5 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : NetworkCommissioningClusterWiFiInterfaceScanResultStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): NetworkCommissioningClusterWiFiInterfaceScanResultStruct { tlvReader.enterStructure(tag) val security = tlvReader.getInt(ContextSpecificTag(TAG_SECURITY)) val ssid = tlvReader.getByteArray(ContextSpecificTag(TAG_SSID)) @@ -73,10 +73,17 @@ class NetworkCommissioningClusterWiFiInterfaceScanResultStruct ( val channel = tlvReader.getInt(ContextSpecificTag(TAG_CHANNEL)) val wiFiBand = tlvReader.getInt(ContextSpecificTag(TAG_WI_FI_BAND)) val rssi = tlvReader.getInt(ContextSpecificTag(TAG_RSSI)) - + tlvReader.exitContainer() - return NetworkCommissioningClusterWiFiInterfaceScanResultStruct(security, ssid, bssid, channel, wiFiBand, rssi) + return NetworkCommissioningClusterWiFiInterfaceScanResultStruct( + security, + ssid, + bssid, + channel, + wiFiBand, + rssi + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt index 620c17f8cd0863..8264e9fa5ee545 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterFabricDescriptorStruct.kt @@ -17,23 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OperationalCredentialsClusterFabricDescriptorStruct ( - val rootPublicKey: ByteArray, - val vendorID: Int, - val fabricID: Long, - val nodeID: Long, - val label: String, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class OperationalCredentialsClusterFabricDescriptorStruct( + val rootPublicKey: ByteArray, + val vendorID: Int, + val fabricID: Long, + val nodeID: Long, + val label: String, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("OperationalCredentialsClusterFabricDescriptorStruct {\n") append("\trootPublicKey : $rootPublicKey\n") append("\tvendorID : $vendorID\n") @@ -65,7 +62,10 @@ class OperationalCredentialsClusterFabricDescriptorStruct ( private const val TAG_LABEL = 5 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalCredentialsClusterFabricDescriptorStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): OperationalCredentialsClusterFabricDescriptorStruct { tlvReader.enterStructure(tag) val rootPublicKey = tlvReader.getByteArray(ContextSpecificTag(TAG_ROOT_PUBLIC_KEY)) val vendorID = tlvReader.getInt(ContextSpecificTag(TAG_VENDOR_I_D)) @@ -73,10 +73,17 @@ class OperationalCredentialsClusterFabricDescriptorStruct ( val nodeID = tlvReader.getLong(ContextSpecificTag(TAG_NODE_I_D)) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return OperationalCredentialsClusterFabricDescriptorStruct(rootPublicKey, vendorID, fabricID, nodeID, label, fabricIndex) + return OperationalCredentialsClusterFabricDescriptorStruct( + rootPublicKey, + vendorID, + fabricID, + nodeID, + label, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt index 406bad431f78c9..a05f388d1a5e06 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalCredentialsClusterNOCStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OperationalCredentialsClusterNOCStruct ( - val noc: ByteArray, - val icac: ByteArray?, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class OperationalCredentialsClusterNOCStruct( + val noc: ByteArray, + val icac: ByteArray?, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("OperationalCredentialsClusterNOCStruct {\n") append("\tnoc : $noc\n") append("\ticac : $icac\n") @@ -43,10 +40,10 @@ class OperationalCredentialsClusterNOCStruct ( startStructure(tag) put(ContextSpecificTag(TAG_NOC), noc) if (icac != null) { - put(ContextSpecificTag(TAG_ICAC), icac) - } else { - putNull(ContextSpecificTag(TAG_ICAC)) - } + put(ContextSpecificTag(TAG_ICAC), icac) + } else { + putNull(ContextSpecificTag(TAG_ICAC)) + } put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex) endStructure() } @@ -57,17 +54,18 @@ class OperationalCredentialsClusterNOCStruct ( private const val TAG_ICAC = 2 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalCredentialsClusterNOCStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalCredentialsClusterNOCStruct { tlvReader.enterStructure(tag) val noc = tlvReader.getByteArray(ContextSpecificTag(TAG_NOC)) - val icac = if (!tlvReader.isNull()) { - tlvReader.getByteArray(ContextSpecificTag(TAG_ICAC)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_ICAC)) - null - } + val icac = + if (!tlvReader.isNull()) { + tlvReader.getByteArray(ContextSpecificTag(TAG_ICAC)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_ICAC)) + null + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() return OperationalCredentialsClusterNOCStruct(noc, icac, fabricIndex) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt index 68879d32ff0bd1..cdbccac37fe63f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterErrorStateStruct.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class OperationalStateClusterErrorStateStruct ( - val errorStateID: Int, - val errorStateLabel: Optional, - val errorStateDetails: Optional) { - override fun toString(): String = buildString { +class OperationalStateClusterErrorStateStruct( + val errorStateID: Int, + val errorStateLabel: Optional, + val errorStateDetails: Optional +) { + override fun toString(): String = buildString { append("OperationalStateClusterErrorStateStruct {\n") append("\terrorStateID : $errorStateID\n") append("\terrorStateLabel : $errorStateLabel\n") @@ -43,13 +41,13 @@ class OperationalStateClusterErrorStateStruct ( startStructure(tag) put(ContextSpecificTag(TAG_ERROR_STATE_I_D), errorStateID) if (errorStateLabel.isPresent) { - val opterrorStateLabel = errorStateLabel.get() - put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) - } + val opterrorStateLabel = errorStateLabel.get() + put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) + } if (errorStateDetails.isPresent) { - val opterrorStateDetails = errorStateDetails.get() - put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) - } + val opterrorStateDetails = errorStateDetails.get() + put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) + } endStructure() } } @@ -59,23 +57,29 @@ class OperationalStateClusterErrorStateStruct ( private const val TAG_ERROR_STATE_LABEL = 1 private const val TAG_ERROR_STATE_DETAILS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterErrorStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterErrorStateStruct { tlvReader.enterStructure(tag) val errorStateID = tlvReader.getInt(ContextSpecificTag(TAG_ERROR_STATE_I_D)) - val errorStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) - } else { - Optional.empty() - } - val errorStateDetails = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) - } else { - Optional.empty() - } - + val errorStateLabel = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) + } else { + Optional.empty() + } + val errorStateDetails = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return OperationalStateClusterErrorStateStruct(errorStateID, errorStateLabel, errorStateDetails) + return OperationalStateClusterErrorStateStruct( + errorStateID, + errorStateLabel, + errorStateDetails + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt index f66152a1cfb5f1..1c55ac8f8927c4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OperationalStateClusterOperationalStateStruct.kt @@ -17,19 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class OperationalStateClusterOperationalStateStruct ( - val operationalStateID: Int, - val operationalStateLabel: Optional) { - override fun toString(): String = buildString { +class OperationalStateClusterOperationalStateStruct( + val operationalStateID: Int, + val operationalStateLabel: Optional +) { + override fun toString(): String = buildString { append("OperationalStateClusterOperationalStateStruct {\n") append("\toperationalStateID : $operationalStateID\n") append("\toperationalStateLabel : $operationalStateLabel\n") @@ -41,9 +39,9 @@ class OperationalStateClusterOperationalStateStruct ( startStructure(tag) put(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D), operationalStateID) if (operationalStateLabel.isPresent) { - val optoperationalStateLabel = operationalStateLabel.get() - put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) - } + val optoperationalStateLabel = operationalStateLabel.get() + put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) + } endStructure() } } @@ -52,18 +50,22 @@ class OperationalStateClusterOperationalStateStruct ( private const val TAG_OPERATIONAL_STATE_I_D = 0 private const val TAG_OPERATIONAL_STATE_LABEL = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OperationalStateClusterOperationalStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): OperationalStateClusterOperationalStateStruct { tlvReader.enterStructure(tag) val operationalStateID = tlvReader.getInt(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D)) - val operationalStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) - } else { - Optional.empty() - } - + val operationalStateLabel = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return OperationalStateClusterOperationalStateStruct(operationalStateID, operationalStateLabel) + return OperationalStateClusterOperationalStateStruct( + operationalStateID, + operationalStateLabel + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt index f527505ff87b22..17f95d897b258b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/OtaSoftwareUpdateRequestorClusterProviderLocation.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class OtaSoftwareUpdateRequestorClusterProviderLocation ( - val providerNodeID: Long, - val endpoint: Int, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class OtaSoftwareUpdateRequestorClusterProviderLocation( + val providerNodeID: Long, + val endpoint: Int, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("OtaSoftwareUpdateRequestorClusterProviderLocation {\n") append("\tproviderNodeID : $providerNodeID\n") append("\tendpoint : $endpoint\n") @@ -53,15 +50,19 @@ class OtaSoftwareUpdateRequestorClusterProviderLocation ( private const val TAG_ENDPOINT = 2 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : OtaSoftwareUpdateRequestorClusterProviderLocation { + fun fromTlv(tag: Tag, tlvReader: TlvReader): OtaSoftwareUpdateRequestorClusterProviderLocation { tlvReader.enterStructure(tag) val providerNodeID = tlvReader.getLong(ContextSpecificTag(TAG_PROVIDER_NODE_I_D)) val endpoint = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return OtaSoftwareUpdateRequestorClusterProviderLocation(providerNodeID, endpoint, fabricIndex) + return OtaSoftwareUpdateRequestorClusterProviderLocation( + providerNodeID, + endpoint, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt index a3e342cf110c49..6172f21498fdb0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatChargeFaultChangeType.kt @@ -20,16 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class PowerSourceClusterBatChargeFaultChangeType ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class PowerSourceClusterBatChargeFaultChangeType(val current: List, val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatChargeFaultChangeType {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +52,25 @@ class PowerSourceClusterBatChargeFaultChangeType ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatChargeFaultChangeType { + fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatChargeFaultChangeType { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatChargeFaultChangeType(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt index 4feef1564786b2..6ef4a63074b8a2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterBatFaultChangeType.kt @@ -20,16 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class PowerSourceClusterBatFaultChangeType ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class PowerSourceClusterBatFaultChangeType(val current: List, val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterBatFaultChangeType {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +52,25 @@ class PowerSourceClusterBatFaultChangeType ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterBatFaultChangeType { + fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterBatFaultChangeType { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterBatFaultChangeType(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt index 6c99e0befd7e37..86cdc01f28fd41 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/PowerSourceClusterWiredFaultChangeType.kt @@ -20,16 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class PowerSourceClusterWiredFaultChangeType ( - val current: List, - val previous: List) { - override fun toString(): String = buildString { +class PowerSourceClusterWiredFaultChangeType(val current: List, val previous: List) { + override fun toString(): String = buildString { append("PowerSourceClusterWiredFaultChangeType {\n") append("\tcurrent : $current\n") append("\tprevious : $previous\n") @@ -57,23 +52,25 @@ class PowerSourceClusterWiredFaultChangeType ( private const val TAG_CURRENT = 0 private const val TAG_PREVIOUS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : PowerSourceClusterWiredFaultChangeType { + fun fromTlv(tag: Tag, tlvReader: TlvReader): PowerSourceClusterWiredFaultChangeType { tlvReader.enterStructure(tag) - val current = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - val previous = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val current = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_CURRENT)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val previous = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_PREVIOUS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return PowerSourceClusterWiredFaultChangeType(current, previous) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt index e3f52fc923d0e9..6632b9581bb508 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct.kt @@ -20,17 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct ( - val label: String, - val mode: Int, - val modeTags: List) { - override fun toString(): String = buildString { +class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( + val label: String, + val mode: Int, + val modeTags: List +) { + override fun toString(): String = buildString { append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -57,21 +55,34 @@ class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct ( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while(!tlvReader.isEndOfContainer()) { - add(RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while (!tlvReader.isEndOfContainer()) { + add( + RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.fromTlv( + AnonymousTag, + tlvReader + ) + ) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() - return RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct(label, mode, modeTags) + return RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( + label, + mode, + modeTags + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt index 7b3fc8ad89ac0a..9f806c52fa6fa2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct.kt @@ -17,19 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct ( - val mfgCode: Optional, - val value: Int) { - override fun toString(): String = buildString { +class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct( + val mfgCode: Optional, + val value: Int +) { + override fun toString(): String = buildString { append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -40,9 +38,9 @@ class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct ( tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -52,15 +50,19 @@ class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct ( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt index 986ef2fbfe7fae..e3f33a1b7dcac5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeOptionStruct.kt @@ -20,17 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class RvcCleanModeClusterModeOptionStruct ( - val label: String, - val mode: Int, - val modeTags: List) { - override fun toString(): String = buildString { +class RvcCleanModeClusterModeOptionStruct( + val label: String, + val mode: Int, + val modeTags: List +) { + override fun toString(): String = buildString { append("RvcCleanModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -57,18 +55,19 @@ class RvcCleanModeClusterModeOptionStruct ( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcCleanModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcCleanModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while(!tlvReader.isEndOfContainer()) { - add(RvcCleanModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while (!tlvReader.isEndOfContainer()) { + add(RvcCleanModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return RvcCleanModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt index d1b5786dd5004d..bc7eb7ed818b41 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcCleanModeClusterModeTagStruct.kt @@ -17,19 +17,14 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class RvcCleanModeClusterModeTagStruct ( - val mfgCode: Optional, - val value: Int) { - override fun toString(): String = buildString { +class RvcCleanModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { + override fun toString(): String = buildString { append("RvcCleanModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -40,9 +35,9 @@ class RvcCleanModeClusterModeTagStruct ( tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -52,15 +47,16 @@ class RvcCleanModeClusterModeTagStruct ( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcCleanModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcCleanModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return RvcCleanModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt index 9416a49dd8d2e1..f6b9b8b14456f0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterErrorStateStruct.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class RvcOperationalStateClusterErrorStateStruct ( - val errorStateID: Int, - val errorStateLabel: Optional, - val errorStateDetails: Optional) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterErrorStateStruct( + val errorStateID: Int, + val errorStateLabel: Optional, + val errorStateDetails: Optional +) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterErrorStateStruct {\n") append("\terrorStateID : $errorStateID\n") append("\terrorStateLabel : $errorStateLabel\n") @@ -43,13 +41,13 @@ class RvcOperationalStateClusterErrorStateStruct ( startStructure(tag) put(ContextSpecificTag(TAG_ERROR_STATE_I_D), errorStateID) if (errorStateLabel.isPresent) { - val opterrorStateLabel = errorStateLabel.get() - put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) - } + val opterrorStateLabel = errorStateLabel.get() + put(ContextSpecificTag(TAG_ERROR_STATE_LABEL), opterrorStateLabel) + } if (errorStateDetails.isPresent) { - val opterrorStateDetails = errorStateDetails.get() - put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) - } + val opterrorStateDetails = errorStateDetails.get() + put(ContextSpecificTag(TAG_ERROR_STATE_DETAILS), opterrorStateDetails) + } endStructure() } } @@ -59,23 +57,29 @@ class RvcOperationalStateClusterErrorStateStruct ( private const val TAG_ERROR_STATE_LABEL = 1 private const val TAG_ERROR_STATE_DETAILS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterErrorStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcOperationalStateClusterErrorStateStruct { tlvReader.enterStructure(tag) val errorStateID = tlvReader.getInt(ContextSpecificTag(TAG_ERROR_STATE_I_D)) - val errorStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) - } else { - Optional.empty() - } - val errorStateDetails = if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) - } else { - Optional.empty() - } - + val errorStateLabel = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_LABEL))) + } else { + Optional.empty() + } + val errorStateDetails = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_ERROR_STATE_DETAILS))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return RvcOperationalStateClusterErrorStateStruct(errorStateID, errorStateLabel, errorStateDetails) + return RvcOperationalStateClusterErrorStateStruct( + errorStateID, + errorStateLabel, + errorStateDetails + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt index 0ac8e7e362c07d..66f2796d71439f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcOperationalStateClusterOperationalStateStruct.kt @@ -17,19 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class RvcOperationalStateClusterOperationalStateStruct ( - val operationalStateID: Int, - val operationalStateLabel: Optional) { - override fun toString(): String = buildString { +class RvcOperationalStateClusterOperationalStateStruct( + val operationalStateID: Int, + val operationalStateLabel: Optional +) { + override fun toString(): String = buildString { append("RvcOperationalStateClusterOperationalStateStruct {\n") append("\toperationalStateID : $operationalStateID\n") append("\toperationalStateLabel : $operationalStateLabel\n") @@ -41,9 +39,9 @@ class RvcOperationalStateClusterOperationalStateStruct ( startStructure(tag) put(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D), operationalStateID) if (operationalStateLabel.isPresent) { - val optoperationalStateLabel = operationalStateLabel.get() - put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) - } + val optoperationalStateLabel = operationalStateLabel.get() + put(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL), optoperationalStateLabel) + } endStructure() } } @@ -52,18 +50,22 @@ class RvcOperationalStateClusterOperationalStateStruct ( private const val TAG_OPERATIONAL_STATE_I_D = 0 private const val TAG_OPERATIONAL_STATE_LABEL = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcOperationalStateClusterOperationalStateStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcOperationalStateClusterOperationalStateStruct { tlvReader.enterStructure(tag) val operationalStateID = tlvReader.getInt(ContextSpecificTag(TAG_OPERATIONAL_STATE_I_D)) - val operationalStateLabel = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) - } else { - Optional.empty() - } - + val operationalStateLabel = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPERATIONAL_STATE_LABEL))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return RvcOperationalStateClusterOperationalStateStruct(operationalStateID, operationalStateLabel) + return RvcOperationalStateClusterOperationalStateStruct( + operationalStateID, + operationalStateLabel + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt index 6c0fa21b62753c..64b272df8e62c2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeOptionStruct.kt @@ -20,17 +20,15 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class RvcRunModeClusterModeOptionStruct ( - val label: String, - val mode: Int, - val modeTags: List) { - override fun toString(): String = buildString { +class RvcRunModeClusterModeOptionStruct( + val label: String, + val mode: Int, + val modeTags: List +) { + override fun toString(): String = buildString { append("RvcRunModeClusterModeOptionStruct {\n") append("\tlabel : $label\n") append("\tmode : $mode\n") @@ -57,18 +55,19 @@ class RvcRunModeClusterModeOptionStruct ( private const val TAG_MODE = 1 private const val TAG_MODE_TAGS = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcRunModeClusterModeOptionStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcRunModeClusterModeOptionStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val mode = tlvReader.getInt(ContextSpecificTag(TAG_MODE)) - val modeTags = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) - while(!tlvReader.isEndOfContainer()) { - add(RvcRunModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val modeTags = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_MODE_TAGS)) + while (!tlvReader.isEndOfContainer()) { + add(RvcRunModeClusterModeTagStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return RvcRunModeClusterModeOptionStruct(label, mode, modeTags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt index 39077679389f9e..3ad4e9aee5ba6d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/RvcRunModeClusterModeTagStruct.kt @@ -17,19 +17,14 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class RvcRunModeClusterModeTagStruct ( - val mfgCode: Optional, - val value: Int) { - override fun toString(): String = buildString { +class RvcRunModeClusterModeTagStruct(val mfgCode: Optional, val value: Int) { + override fun toString(): String = buildString { append("RvcRunModeClusterModeTagStruct {\n") append("\tmfgCode : $mfgCode\n") append("\tvalue : $value\n") @@ -40,9 +35,9 @@ class RvcRunModeClusterModeTagStruct ( tlvWriter.apply { startStructure(tag) if (mfgCode.isPresent) { - val optmfgCode = mfgCode.get() - put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) - } + val optmfgCode = mfgCode.get() + put(ContextSpecificTag(TAG_MFG_CODE), optmfgCode) + } put(ContextSpecificTag(TAG_VALUE), value) endStructure() } @@ -52,15 +47,16 @@ class RvcRunModeClusterModeTagStruct ( private const val TAG_MFG_CODE = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : RvcRunModeClusterModeTagStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): RvcRunModeClusterModeTagStruct { tlvReader.enterStructure(tag) - val mfgCode = if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) - } else { - Optional.empty() - } + val mfgCode = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MFG_CODE))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_MFG_CODE))) + } else { + Optional.empty() + } val value = tlvReader.getInt(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return RvcRunModeClusterModeTagStruct(mfgCode, value) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt index 3376a7d1e849f2..213d87b9137cf5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterAttributeValuePair.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ScenesClusterAttributeValuePair ( - val attributeID: Long, - val attributeValue: Long) { - override fun toString(): String = buildString { +class ScenesClusterAttributeValuePair(val attributeID: Long, val attributeValue: Long) { + override fun toString(): String = buildString { append("ScenesClusterAttributeValuePair {\n") append("\tattributeID : $attributeID\n") append("\tattributeValue : $attributeValue\n") @@ -49,11 +43,11 @@ class ScenesClusterAttributeValuePair ( private const val TAG_ATTRIBUTE_I_D = 0 private const val TAG_ATTRIBUTE_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ScenesClusterAttributeValuePair { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ScenesClusterAttributeValuePair { tlvReader.enterStructure(tag) val attributeID = tlvReader.getLong(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) val attributeValue = tlvReader.getLong(ContextSpecificTag(TAG_ATTRIBUTE_VALUE)) - + tlvReader.exitContainer() return ScenesClusterAttributeValuePair(attributeID, attributeValue) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt index dde3ec639661d9..edc04a2084e2fd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ScenesClusterExtensionFieldSet.kt @@ -20,16 +20,14 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ScenesClusterExtensionFieldSet ( - val clusterID: Long, - val attributeValueList: List) { - override fun toString(): String = buildString { +class ScenesClusterExtensionFieldSet( + val clusterID: Long, + val attributeValueList: List +) { + override fun toString(): String = buildString { append("ScenesClusterExtensionFieldSet {\n") append("\tclusterID : $clusterID\n") append("\tattributeValueList : $attributeValueList\n") @@ -53,17 +51,18 @@ class ScenesClusterExtensionFieldSet ( private const val TAG_CLUSTER_I_D = 0 private const val TAG_ATTRIBUTE_VALUE_LIST = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ScenesClusterExtensionFieldSet { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ScenesClusterExtensionFieldSet { tlvReader.enterStructure(tag) val clusterID = tlvReader.getLong(ContextSpecificTag(TAG_CLUSTER_I_D)) - val attributeValueList = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_ATTRIBUTE_VALUE_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(ScenesClusterAttributeValuePair.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val attributeValueList = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_ATTRIBUTE_VALUE_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(ScenesClusterAttributeValuePair.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return ScenesClusterExtensionFieldSet(clusterID, attributeValueList) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt index ae6aa79702b58b..5359b9a4b70a2a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt @@ -17,22 +17,20 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class SoftwareDiagnosticsClusterThreadMetricsStruct ( - val id: Long, - val name: Optional, - val stackFreeCurrent: Optional, - val stackFreeMinimum: Optional, - val stackSize: Optional) { - override fun toString(): String = buildString { +class SoftwareDiagnosticsClusterThreadMetricsStruct( + val id: Long, + val name: Optional, + val stackFreeCurrent: Optional, + val stackFreeMinimum: Optional, + val stackSize: Optional +) { + override fun toString(): String = buildString { append("SoftwareDiagnosticsClusterThreadMetricsStruct {\n") append("\tid : $id\n") append("\tname : $name\n") @@ -47,21 +45,21 @@ class SoftwareDiagnosticsClusterThreadMetricsStruct ( startStructure(tag) put(ContextSpecificTag(TAG_ID), id) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } if (stackFreeCurrent.isPresent) { - val optstackFreeCurrent = stackFreeCurrent.get() - put(ContextSpecificTag(TAG_STACK_FREE_CURRENT), optstackFreeCurrent) - } + val optstackFreeCurrent = stackFreeCurrent.get() + put(ContextSpecificTag(TAG_STACK_FREE_CURRENT), optstackFreeCurrent) + } if (stackFreeMinimum.isPresent) { - val optstackFreeMinimum = stackFreeMinimum.get() - put(ContextSpecificTag(TAG_STACK_FREE_MINIMUM), optstackFreeMinimum) - } + val optstackFreeMinimum = stackFreeMinimum.get() + put(ContextSpecificTag(TAG_STACK_FREE_MINIMUM), optstackFreeMinimum) + } if (stackSize.isPresent) { - val optstackSize = stackSize.get() - put(ContextSpecificTag(TAG_STACK_SIZE), optstackSize) - } + val optstackSize = stackSize.get() + put(ContextSpecificTag(TAG_STACK_SIZE), optstackSize) + } endStructure() } } @@ -73,33 +71,43 @@ class SoftwareDiagnosticsClusterThreadMetricsStruct ( private const val TAG_STACK_FREE_MINIMUM = 3 private const val TAG_STACK_SIZE = 4 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : SoftwareDiagnosticsClusterThreadMetricsStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): SoftwareDiagnosticsClusterThreadMetricsStruct { tlvReader.enterStructure(tag) val id = tlvReader.getLong(ContextSpecificTag(TAG_ID)) - val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - val stackFreeCurrent = if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) - } else { - Optional.empty() - } - val stackFreeMinimum = if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) - } else { - Optional.empty() - } - val stackSize = if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_SIZE))) { - Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_SIZE))) - } else { - Optional.empty() - } - + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + val stackFreeCurrent = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_CURRENT))) + } else { + Optional.empty() + } + val stackFreeMinimum = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_FREE_MINIMUM))) + } else { + Optional.empty() + } + val stackSize = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STACK_SIZE))) { + Optional.of(tlvReader.getLong(ContextSpecificTag(TAG_STACK_SIZE))) + } else { + Optional.empty() + } + tlvReader.exitContainer() - return SoftwareDiagnosticsClusterThreadMetricsStruct(id, name, stackFreeCurrent, stackFreeMinimum, stackSize) + return SoftwareDiagnosticsClusterThreadMetricsStruct( + id, + name, + stackFreeCurrent, + stackFreeMinimum, + stackSize + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt index 475ba3c436fac7..403134993beaed 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class TargetNavigatorClusterTargetInfoStruct ( - val identifier: Int, - val name: String) { - override fun toString(): String = buildString { +class TargetNavigatorClusterTargetInfoStruct(val identifier: Int, val name: String) { + override fun toString(): String = buildString { append("TargetNavigatorClusterTargetInfoStruct {\n") append("\tidentifier : $identifier\n") append("\tname : $name\n") @@ -49,11 +43,11 @@ class TargetNavigatorClusterTargetInfoStruct ( private const val TAG_IDENTIFIER = 0 private const val TAG_NAME = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TargetNavigatorClusterTargetInfoStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): TargetNavigatorClusterTargetInfoStruct { tlvReader.enterStructure(tag) val identifier = tlvReader.getInt(ContextSpecificTag(TAG_IDENTIFIER)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) - + tlvReader.exitContainer() return TargetNavigatorClusterTargetInfoStruct(identifier, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt index f63d1bcf959e9e..cb432fb1e976b4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterThermostatScheduleTransition.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThermostatClusterThermostatScheduleTransition ( - val transitionTime: Int, - val heatSetpoint: Int?, - val coolSetpoint: Int?) { - override fun toString(): String = buildString { +class ThermostatClusterThermostatScheduleTransition( + val transitionTime: Int, + val heatSetpoint: Int?, + val coolSetpoint: Int? +) { + override fun toString(): String = buildString { append("ThermostatClusterThermostatScheduleTransition {\n") append("\ttransitionTime : $transitionTime\n") append("\theatSetpoint : $heatSetpoint\n") @@ -43,15 +40,15 @@ class ThermostatClusterThermostatScheduleTransition ( startStructure(tag) put(ContextSpecificTag(TAG_TRANSITION_TIME), transitionTime) if (heatSetpoint != null) { - put(ContextSpecificTag(TAG_HEAT_SETPOINT), heatSetpoint) - } else { - putNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) - } + put(ContextSpecificTag(TAG_HEAT_SETPOINT), heatSetpoint) + } else { + putNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) + } if (coolSetpoint != null) { - put(ContextSpecificTag(TAG_COOL_SETPOINT), coolSetpoint) - } else { - putNull(ContextSpecificTag(TAG_COOL_SETPOINT)) - } + put(ContextSpecificTag(TAG_COOL_SETPOINT), coolSetpoint) + } else { + putNull(ContextSpecificTag(TAG_COOL_SETPOINT)) + } endStructure() } } @@ -61,25 +58,31 @@ class ThermostatClusterThermostatScheduleTransition ( private const val TAG_HEAT_SETPOINT = 1 private const val TAG_COOL_SETPOINT = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThermostatClusterThermostatScheduleTransition { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ThermostatClusterThermostatScheduleTransition { tlvReader.enterStructure(tag) val transitionTime = tlvReader.getInt(ContextSpecificTag(TAG_TRANSITION_TIME)) - val heatSetpoint = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_HEAT_SETPOINT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) - null - } - val coolSetpoint = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_COOL_SETPOINT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_COOL_SETPOINT)) - null - } - + val heatSetpoint = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_HEAT_SETPOINT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_HEAT_SETPOINT)) + null + } + val coolSetpoint = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_COOL_SETPOINT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_COOL_SETPOINT)) + null + } + tlvReader.exitContainer() - return ThermostatClusterThermostatScheduleTransition(transitionTime, heatSetpoint, coolSetpoint) + return ThermostatClusterThermostatScheduleTransition( + transitionTime, + heatSetpoint, + coolSetpoint + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt index 5fbc0d517459c1..4a7066df5d7f25 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterNeighborTableStruct.kt @@ -17,31 +17,28 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThreadNetworkDiagnosticsClusterNeighborTableStruct ( - val extAddress: Long, - val age: Long, - val rloc16: Int, - val linkFrameCounter: Long, - val mleFrameCounter: Long, - val lqi: Int, - val averageRssi: Int?, - val lastRssi: Int?, - val frameErrorRate: Int, - val messageErrorRate: Int, - val rxOnWhenIdle: Boolean, - val fullThreadDevice: Boolean, - val fullNetworkData: Boolean, - val isChild: Boolean) { - override fun toString(): String = buildString { +class ThreadNetworkDiagnosticsClusterNeighborTableStruct( + val extAddress: Long, + val age: Long, + val rloc16: Int, + val linkFrameCounter: Long, + val mleFrameCounter: Long, + val lqi: Int, + val averageRssi: Int?, + val lastRssi: Int?, + val frameErrorRate: Int, + val messageErrorRate: Int, + val rxOnWhenIdle: Boolean, + val fullThreadDevice: Boolean, + val fullNetworkData: Boolean, + val isChild: Boolean +) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterNeighborTableStruct {\n") append("\textAddress : $extAddress\n") append("\tage : $age\n") @@ -70,15 +67,15 @@ class ThreadNetworkDiagnosticsClusterNeighborTableStruct ( put(ContextSpecificTag(TAG_MLE_FRAME_COUNTER), mleFrameCounter) put(ContextSpecificTag(TAG_LQI), lqi) if (averageRssi != null) { - put(ContextSpecificTag(TAG_AVERAGE_RSSI), averageRssi) - } else { - putNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) - } + put(ContextSpecificTag(TAG_AVERAGE_RSSI), averageRssi) + } else { + putNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) + } if (lastRssi != null) { - put(ContextSpecificTag(TAG_LAST_RSSI), lastRssi) - } else { - putNull(ContextSpecificTag(TAG_LAST_RSSI)) - } + put(ContextSpecificTag(TAG_LAST_RSSI), lastRssi) + } else { + putNull(ContextSpecificTag(TAG_LAST_RSSI)) + } put(ContextSpecificTag(TAG_FRAME_ERROR_RATE), frameErrorRate) put(ContextSpecificTag(TAG_MESSAGE_ERROR_RATE), messageErrorRate) put(ContextSpecificTag(TAG_RX_ON_WHEN_IDLE), rxOnWhenIdle) @@ -105,7 +102,10 @@ class ThreadNetworkDiagnosticsClusterNeighborTableStruct ( private const val TAG_FULL_NETWORK_DATA = 12 private const val TAG_IS_CHILD = 13 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterNeighborTableStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): ThreadNetworkDiagnosticsClusterNeighborTableStruct { tlvReader.enterStructure(tag) val extAddress = tlvReader.getLong(ContextSpecificTag(TAG_EXT_ADDRESS)) val age = tlvReader.getLong(ContextSpecificTag(TAG_AGE)) @@ -113,28 +113,45 @@ class ThreadNetworkDiagnosticsClusterNeighborTableStruct ( val linkFrameCounter = tlvReader.getLong(ContextSpecificTag(TAG_LINK_FRAME_COUNTER)) val mleFrameCounter = tlvReader.getLong(ContextSpecificTag(TAG_MLE_FRAME_COUNTER)) val lqi = tlvReader.getInt(ContextSpecificTag(TAG_LQI)) - val averageRssi = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_AVERAGE_RSSI)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) - null - } - val lastRssi = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_LAST_RSSI)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_LAST_RSSI)) - null - } + val averageRssi = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_AVERAGE_RSSI)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AVERAGE_RSSI)) + null + } + val lastRssi = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_LAST_RSSI)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_LAST_RSSI)) + null + } val frameErrorRate = tlvReader.getInt(ContextSpecificTag(TAG_FRAME_ERROR_RATE)) val messageErrorRate = tlvReader.getInt(ContextSpecificTag(TAG_MESSAGE_ERROR_RATE)) val rxOnWhenIdle = tlvReader.getBoolean(ContextSpecificTag(TAG_RX_ON_WHEN_IDLE)) val fullThreadDevice = tlvReader.getBoolean(ContextSpecificTag(TAG_FULL_THREAD_DEVICE)) val fullNetworkData = tlvReader.getBoolean(ContextSpecificTag(TAG_FULL_NETWORK_DATA)) val isChild = tlvReader.getBoolean(ContextSpecificTag(TAG_IS_CHILD)) - + tlvReader.exitContainer() - return ThreadNetworkDiagnosticsClusterNeighborTableStruct(extAddress, age, rloc16, linkFrameCounter, mleFrameCounter, lqi, averageRssi, lastRssi, frameErrorRate, messageErrorRate, rxOnWhenIdle, fullThreadDevice, fullNetworkData, isChild) + return ThreadNetworkDiagnosticsClusterNeighborTableStruct( + extAddress, + age, + rloc16, + linkFrameCounter, + mleFrameCounter, + lqi, + averageRssi, + lastRssi, + frameErrorRate, + messageErrorRate, + rxOnWhenIdle, + fullThreadDevice, + fullNetworkData, + isChild + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt index 7276a7f3eccac4..f9764369891073 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterOperationalDatasetComponents.kt @@ -17,29 +17,26 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThreadNetworkDiagnosticsClusterOperationalDatasetComponents ( - val activeTimestampPresent: Boolean, - val pendingTimestampPresent: Boolean, - val masterKeyPresent: Boolean, - val networkNamePresent: Boolean, - val extendedPanIdPresent: Boolean, - val meshLocalPrefixPresent: Boolean, - val delayPresent: Boolean, - val panIdPresent: Boolean, - val channelPresent: Boolean, - val pskcPresent: Boolean, - val securityPolicyPresent: Boolean, - val channelMaskPresent: Boolean) { - override fun toString(): String = buildString { +class ThreadNetworkDiagnosticsClusterOperationalDatasetComponents( + val activeTimestampPresent: Boolean, + val pendingTimestampPresent: Boolean, + val masterKeyPresent: Boolean, + val networkNamePresent: Boolean, + val extendedPanIdPresent: Boolean, + val meshLocalPrefixPresent: Boolean, + val delayPresent: Boolean, + val panIdPresent: Boolean, + val channelPresent: Boolean, + val pskcPresent: Boolean, + val securityPolicyPresent: Boolean, + val channelMaskPresent: Boolean +) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterOperationalDatasetComponents {\n") append("\tactiveTimestampPresent : $activeTimestampPresent\n") append("\tpendingTimestampPresent : $pendingTimestampPresent\n") @@ -89,24 +86,45 @@ class ThreadNetworkDiagnosticsClusterOperationalDatasetComponents ( private const val TAG_SECURITY_POLICY_PRESENT = 10 private const val TAG_CHANNEL_MASK_PRESENT = 11 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterOperationalDatasetComponents { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): ThreadNetworkDiagnosticsClusterOperationalDatasetComponents { tlvReader.enterStructure(tag) - val activeTimestampPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_ACTIVE_TIMESTAMP_PRESENT)) - val pendingTimestampPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_PENDING_TIMESTAMP_PRESENT)) + val activeTimestampPresent = + tlvReader.getBoolean(ContextSpecificTag(TAG_ACTIVE_TIMESTAMP_PRESENT)) + val pendingTimestampPresent = + tlvReader.getBoolean(ContextSpecificTag(TAG_PENDING_TIMESTAMP_PRESENT)) val masterKeyPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_MASTER_KEY_PRESENT)) val networkNamePresent = tlvReader.getBoolean(ContextSpecificTag(TAG_NETWORK_NAME_PRESENT)) - val extendedPanIdPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_EXTENDED_PAN_ID_PRESENT)) - val meshLocalPrefixPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_MESH_LOCAL_PREFIX_PRESENT)) + val extendedPanIdPresent = + tlvReader.getBoolean(ContextSpecificTag(TAG_EXTENDED_PAN_ID_PRESENT)) + val meshLocalPrefixPresent = + tlvReader.getBoolean(ContextSpecificTag(TAG_MESH_LOCAL_PREFIX_PRESENT)) val delayPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_DELAY_PRESENT)) val panIdPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_PAN_ID_PRESENT)) val channelPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_CHANNEL_PRESENT)) val pskcPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_PSKC_PRESENT)) - val securityPolicyPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_SECURITY_POLICY_PRESENT)) + val securityPolicyPresent = + tlvReader.getBoolean(ContextSpecificTag(TAG_SECURITY_POLICY_PRESENT)) val channelMaskPresent = tlvReader.getBoolean(ContextSpecificTag(TAG_CHANNEL_MASK_PRESENT)) - + tlvReader.exitContainer() - return ThreadNetworkDiagnosticsClusterOperationalDatasetComponents(activeTimestampPresent, pendingTimestampPresent, masterKeyPresent, networkNamePresent, extendedPanIdPresent, meshLocalPrefixPresent, delayPresent, panIdPresent, channelPresent, pskcPresent, securityPolicyPresent, channelMaskPresent) + return ThreadNetworkDiagnosticsClusterOperationalDatasetComponents( + activeTimestampPresent, + pendingTimestampPresent, + masterKeyPresent, + networkNamePresent, + extendedPanIdPresent, + meshLocalPrefixPresent, + delayPresent, + panIdPresent, + channelPresent, + pskcPresent, + securityPolicyPresent, + channelMaskPresent + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt index c204266b42fcf5..8a7c423f84e6ad 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterRouteTableStruct.kt @@ -17,27 +17,24 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThreadNetworkDiagnosticsClusterRouteTableStruct ( - val extAddress: Long, - val rloc16: Int, - val routerId: Int, - val nextHop: Int, - val pathCost: Int, - val LQIIn: Int, - val LQIOut: Int, - val age: Int, - val allocated: Boolean, - val linkEstablished: Boolean) { - override fun toString(): String = buildString { +class ThreadNetworkDiagnosticsClusterRouteTableStruct( + val extAddress: Long, + val rloc16: Int, + val routerId: Int, + val nextHop: Int, + val pathCost: Int, + val LQIIn: Int, + val LQIOut: Int, + val age: Int, + val allocated: Boolean, + val linkEstablished: Boolean +) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterRouteTableStruct {\n") append("\textAddress : $extAddress\n") append("\trloc16 : $rloc16\n") @@ -81,7 +78,7 @@ class ThreadNetworkDiagnosticsClusterRouteTableStruct ( private const val TAG_ALLOCATED = 8 private const val TAG_LINK_ESTABLISHED = 9 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterRouteTableStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ThreadNetworkDiagnosticsClusterRouteTableStruct { tlvReader.enterStructure(tag) val extAddress = tlvReader.getLong(ContextSpecificTag(TAG_EXT_ADDRESS)) val rloc16 = tlvReader.getInt(ContextSpecificTag(TAG_RLOC16)) @@ -93,10 +90,21 @@ class ThreadNetworkDiagnosticsClusterRouteTableStruct ( val age = tlvReader.getInt(ContextSpecificTag(TAG_AGE)) val allocated = tlvReader.getBoolean(ContextSpecificTag(TAG_ALLOCATED)) val linkEstablished = tlvReader.getBoolean(ContextSpecificTag(TAG_LINK_ESTABLISHED)) - + tlvReader.exitContainer() - return ThreadNetworkDiagnosticsClusterRouteTableStruct(extAddress, rloc16, routerId, nextHop, pathCost, LQIIn, LQIOut, age, allocated, linkEstablished) + return ThreadNetworkDiagnosticsClusterRouteTableStruct( + extAddress, + rloc16, + routerId, + nextHop, + pathCost, + LQIIn, + LQIOut, + age, + allocated, + linkEstablished + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt index d12f6e24c345f9..1474db405b9d43 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThreadNetworkDiagnosticsClusterSecurityPolicy.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class ThreadNetworkDiagnosticsClusterSecurityPolicy ( - val rotationTime: Int, - val flags: Int) { - override fun toString(): String = buildString { +class ThreadNetworkDiagnosticsClusterSecurityPolicy(val rotationTime: Int, val flags: Int) { + override fun toString(): String = buildString { append("ThreadNetworkDiagnosticsClusterSecurityPolicy {\n") append("\trotationTime : $rotationTime\n") append("\tflags : $flags\n") @@ -49,11 +43,11 @@ class ThreadNetworkDiagnosticsClusterSecurityPolicy ( private const val TAG_ROTATION_TIME = 0 private const val TAG_FLAGS = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : ThreadNetworkDiagnosticsClusterSecurityPolicy { + fun fromTlv(tag: Tag, tlvReader: TlvReader): ThreadNetworkDiagnosticsClusterSecurityPolicy { tlvReader.enterStructure(tag) val rotationTime = tlvReader.getInt(ContextSpecificTag(TAG_ROTATION_TIME)) val flags = tlvReader.getInt(ContextSpecificTag(TAG_FLAGS)) - + tlvReader.exitContainer() return ThreadNetworkDiagnosticsClusterSecurityPolicy(rotationTime, flags) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt index be643cca35be70..d770d7a2ac8e03 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterDSTOffsetStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class TimeSynchronizationClusterDSTOffsetStruct ( - val offset: Long, - val validStarting: Long, - val validUntil: Long?) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterDSTOffsetStruct( + val offset: Long, + val validStarting: Long, + val validUntil: Long? +) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterDSTOffsetStruct {\n") append("\toffset : $offset\n") append("\tvalidStarting : $validStarting\n") @@ -44,10 +41,10 @@ class TimeSynchronizationClusterDSTOffsetStruct ( put(ContextSpecificTag(TAG_OFFSET), offset) put(ContextSpecificTag(TAG_VALID_STARTING), validStarting) if (validUntil != null) { - put(ContextSpecificTag(TAG_VALID_UNTIL), validUntil) - } else { - putNull(ContextSpecificTag(TAG_VALID_UNTIL)) - } + put(ContextSpecificTag(TAG_VALID_UNTIL), validUntil) + } else { + putNull(ContextSpecificTag(TAG_VALID_UNTIL)) + } endStructure() } } @@ -57,17 +54,18 @@ class TimeSynchronizationClusterDSTOffsetStruct ( private const val TAG_VALID_STARTING = 1 private const val TAG_VALID_UNTIL = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterDSTOffsetStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterDSTOffsetStruct { tlvReader.enterStructure(tag) val offset = tlvReader.getLong(ContextSpecificTag(TAG_OFFSET)) val validStarting = tlvReader.getLong(ContextSpecificTag(TAG_VALID_STARTING)) - val validUntil = if (!tlvReader.isNull()) { - tlvReader.getLong(ContextSpecificTag(TAG_VALID_UNTIL)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_VALID_UNTIL)) - null - } - + val validUntil = + if (!tlvReader.isNull()) { + tlvReader.getLong(ContextSpecificTag(TAG_VALID_UNTIL)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VALID_UNTIL)) + null + } + tlvReader.exitContainer() return TimeSynchronizationClusterDSTOffsetStruct(offset, validStarting, validUntil) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt index 8c3acf12fe54e8..7a2e95c671517a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct.kt @@ -17,19 +17,16 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct ( - val nodeID: Long, - val endpoint: Int) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct( + val nodeID: Long, + val endpoint: Int +) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct {\n") append("\tnodeID : $nodeID\n") append("\tendpoint : $endpoint\n") @@ -49,11 +46,14 @@ class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct ( private const val TAG_NODE_I_D = 0 private const val TAG_ENDPOINT = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct { + fun fromTlv( + tag: Tag, + tlvReader: TlvReader + ): TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct { tlvReader.enterStructure(tag) val nodeID = tlvReader.getLong(ContextSpecificTag(TAG_NODE_I_D)) val endpoint = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) - + tlvReader.exitContainer() return TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct(nodeID, endpoint) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt index 11bdbff1851eaf..8a256fd7edfefe 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTimeZoneStruct.kt @@ -17,20 +17,18 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class TimeSynchronizationClusterTimeZoneStruct ( - val offset: Long, - val validAt: Long, - val name: Optional) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterTimeZoneStruct( + val offset: Long, + val validAt: Long, + val name: Optional +) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterTimeZoneStruct {\n") append("\toffset : $offset\n") append("\tvalidAt : $validAt\n") @@ -44,9 +42,9 @@ class TimeSynchronizationClusterTimeZoneStruct ( put(ContextSpecificTag(TAG_OFFSET), offset) put(ContextSpecificTag(TAG_VALID_AT), validAt) if (name.isPresent) { - val optname = name.get() - put(ContextSpecificTag(TAG_NAME), optname) - } + val optname = name.get() + put(ContextSpecificTag(TAG_NAME), optname) + } endStructure() } } @@ -56,16 +54,17 @@ class TimeSynchronizationClusterTimeZoneStruct ( private const val TAG_VALID_AT = 1 private const val TAG_NAME = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterTimeZoneStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterTimeZoneStruct { tlvReader.enterStructure(tag) val offset = tlvReader.getLong(ContextSpecificTag(TAG_OFFSET)) val validAt = tlvReader.getLong(ContextSpecificTag(TAG_VALID_AT)) - val name = if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) - } else { - Optional.empty() - } - + val name = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NAME))) + } else { + Optional.empty() + } + tlvReader.exitContainer() return TimeSynchronizationClusterTimeZoneStruct(offset, validAt, name) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt index 668f0c1e923143..db50619ad5da53 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TimeSynchronizationClusterTrustedTimeSourceStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class TimeSynchronizationClusterTrustedTimeSourceStruct ( - val fabricIndex: Int, - val nodeID: Long, - val endpoint: Int) { - override fun toString(): String = buildString { +class TimeSynchronizationClusterTrustedTimeSourceStruct( + val fabricIndex: Int, + val nodeID: Long, + val endpoint: Int +) { + override fun toString(): String = buildString { append("TimeSynchronizationClusterTrustedTimeSourceStruct {\n") append("\tfabricIndex : $fabricIndex\n") append("\tnodeID : $nodeID\n") @@ -53,12 +50,12 @@ class TimeSynchronizationClusterTrustedTimeSourceStruct ( private const val TAG_NODE_I_D = 1 private const val TAG_ENDPOINT = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : TimeSynchronizationClusterTrustedTimeSourceStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): TimeSynchronizationClusterTrustedTimeSourceStruct { tlvReader.enterStructure(tag) val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) val nodeID = tlvReader.getLong(ContextSpecificTag(TAG_NODE_I_D)) val endpoint = tlvReader.getInt(ContextSpecificTag(TAG_ENDPOINT)) - + tlvReader.exitContainer() return TimeSynchronizationClusterTrustedTimeSourceStruct(fabricIndex, nodeID, endpoint) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt index ed3e7a0ef74243..bd34e9f5a90c49 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterDoubleNestedStructList.kt @@ -20,15 +20,11 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterDoubleNestedStructList ( - val a: List) { - override fun toString(): String = buildString { +class UnitTestingClusterDoubleNestedStructList(val a: List) { + override fun toString(): String = buildString { append("UnitTestingClusterDoubleNestedStructList {\n") append("\ta : $a\n") append("}\n") @@ -49,16 +45,17 @@ class UnitTestingClusterDoubleNestedStructList ( companion object { private const val TAG_A = 0 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterDoubleNestedStructList { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterDoubleNestedStructList { tlvReader.enterStructure(tag) - val a = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_A)) - while(!tlvReader.isEndOfContainer()) { - add(UnitTestingClusterNestedStructList.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - + val a = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_A)) + while (!tlvReader.isEndOfContainer()) { + add(UnitTestingClusterNestedStructList.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return UnitTestingClusterDoubleNestedStructList(a) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt index c0de5e08f6886b..7ca3b0b29aab01 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt @@ -17,20 +17,17 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterNestedStruct ( - val a: Int, - val b: Boolean, - val c: UnitTestingClusterSimpleStruct) { - override fun toString(): String = buildString { +class UnitTestingClusterNestedStruct( + val a: Int, + val b: Boolean, + val c: UnitTestingClusterSimpleStruct +) { + override fun toString(): String = buildString { append("UnitTestingClusterNestedStruct {\n") append("\ta : $a\n") append("\tb : $b\n") @@ -53,12 +50,12 @@ class UnitTestingClusterNestedStruct ( private const val TAG_B = 1 private const val TAG_C = 2 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterNestedStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStruct { tlvReader.enterStructure(tag) val a = tlvReader.getInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader) - + tlvReader.exitContainer() return UnitTestingClusterNestedStruct(a, b, c) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt index 9b41c3e439e192..b954fe0ec9879b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStructList.kt @@ -20,21 +20,19 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterNestedStructList ( - val a: Int, - val b: Boolean, - val c: UnitTestingClusterSimpleStruct, - val d: List, - val e: List, - val f: List, - val g: List) { - override fun toString(): String = buildString { +class UnitTestingClusterNestedStructList( + val a: Int, + val b: Boolean, + val c: UnitTestingClusterSimpleStruct, + val d: List, + val e: List, + val f: List, + val g: List +) { + override fun toString(): String = buildString { append("UnitTestingClusterNestedStructList {\n") append("\ta : $a\n") append("\tb : $b\n") @@ -85,40 +83,44 @@ class UnitTestingClusterNestedStructList ( private const val TAG_F = 5 private const val TAG_G = 6 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterNestedStructList { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStructList { tlvReader.enterStructure(tag) val a = tlvReader.getInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader) - val d = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_D)) - while(!tlvReader.isEndOfContainer()) { - add(UnitTestingClusterSimpleStruct.fromTlv(AnonymousTag, tlvReader)) - } - tlvReader.exitContainer() - } - val e = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_E)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getLong(AnonymousTag)) - } - tlvReader.exitContainer() - } - val f = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_F)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getByteArray(AnonymousTag)) - } - tlvReader.exitContainer() - } - val g = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_G)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - + val d = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_D)) + while (!tlvReader.isEndOfContainer()) { + add(UnitTestingClusterSimpleStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val e = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_E)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getLong(AnonymousTag)) + } + tlvReader.exitContainer() + } + val f = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_F)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getByteArray(AnonymousTag)) + } + tlvReader.exitContainer() + } + val g = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_G)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + tlvReader.exitContainer() return UnitTestingClusterNestedStructList(a, b, c, d, e, f, g) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt index 1533278b6a1fac..08a4b642e69d45 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt @@ -20,26 +20,25 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class UnitTestingClusterNullablesAndOptionalsStruct ( - val nullableInt: Int?, - val optionalInt: Optional, - val nullableOptionalInt: Optional?, - val nullableString: String?, - val optionalString: Optional, - val nullableOptionalString: Optional?, - val nullableStruct: UnitTestingClusterSimpleStruct?, - val optionalStruct: Optional, - val nullableOptionalStruct: Optional?, - val nullableList: List?, - val optionalList: Optional>, - val nullableOptionalList: Optional>?) { - override fun toString(): String = buildString { +class UnitTestingClusterNullablesAndOptionalsStruct( + val nullableInt: Int?, + val optionalInt: Optional, + val nullableOptionalInt: Optional?, + val nullableString: String?, + val optionalString: Optional, + val nullableOptionalString: Optional?, + val nullableStruct: UnitTestingClusterSimpleStruct?, + val optionalStruct: Optional, + val nullableOptionalStruct: Optional?, + val nullableList: List?, + val optionalList: Optional>, + val nullableOptionalList: Optional>? +) { + override fun toString(): String = buildString { append("UnitTestingClusterNullablesAndOptionalsStruct {\n") append("\tnullableInt : $nullableInt\n") append("\toptionalInt : $optionalInt\n") @@ -60,85 +59,85 @@ class UnitTestingClusterNullablesAndOptionalsStruct ( tlvWriter.apply { startStructure(tag) if (nullableInt != null) { - put(ContextSpecificTag(TAG_NULLABLE_INT), nullableInt) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_INT)) - } + put(ContextSpecificTag(TAG_NULLABLE_INT), nullableInt) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_INT)) + } if (optionalInt.isPresent) { - val optoptionalInt = optionalInt.get() - put(ContextSpecificTag(TAG_OPTIONAL_INT), optoptionalInt) - } + val optoptionalInt = optionalInt.get() + put(ContextSpecificTag(TAG_OPTIONAL_INT), optoptionalInt) + } if (nullableOptionalInt != null) { - if (nullableOptionalInt.isPresent) { - val optnullableOptionalInt = nullableOptionalInt.get() - put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT), optnullableOptionalInt) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) - } + if (nullableOptionalInt.isPresent) { + val optnullableOptionalInt = nullableOptionalInt.get() + put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT), optnullableOptionalInt) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) + } if (nullableString != null) { - put(ContextSpecificTag(TAG_NULLABLE_STRING), nullableString) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_STRING)) - } + put(ContextSpecificTag(TAG_NULLABLE_STRING), nullableString) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_STRING)) + } if (optionalString.isPresent) { - val optoptionalString = optionalString.get() - put(ContextSpecificTag(TAG_OPTIONAL_STRING), optoptionalString) - } + val optoptionalString = optionalString.get() + put(ContextSpecificTag(TAG_OPTIONAL_STRING), optoptionalString) + } if (nullableOptionalString != null) { - if (nullableOptionalString.isPresent) { - val optnullableOptionalString = nullableOptionalString.get() - put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING), optnullableOptionalString) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) - } + if (nullableOptionalString.isPresent) { + val optnullableOptionalString = nullableOptionalString.get() + put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING), optnullableOptionalString) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) + } if (nullableStruct != null) { - nullableStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), this) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) - } + nullableStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), this) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) + } if (optionalStruct.isPresent) { - val optoptionalStruct = optionalStruct.get() - optoptionalStruct.toTlv(ContextSpecificTag(TAG_OPTIONAL_STRUCT), this) - } + val optoptionalStruct = optionalStruct.get() + optoptionalStruct.toTlv(ContextSpecificTag(TAG_OPTIONAL_STRUCT), this) + } if (nullableOptionalStruct != null) { - if (nullableOptionalStruct.isPresent) { - val optnullableOptionalStruct = nullableOptionalStruct.get() - optnullableOptionalStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), this) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) - } + if (nullableOptionalStruct.isPresent) { + val optnullableOptionalStruct = nullableOptionalStruct.get() + optnullableOptionalStruct.toTlv(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), this) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) + } if (nullableList != null) { - startList(ContextSpecificTag(TAG_NULLABLE_LIST)) - for (item in nullableList.iterator()) { - put(AnonymousTag, item) + startList(ContextSpecificTag(TAG_NULLABLE_LIST)) + for (item in nullableList.iterator()) { + put(AnonymousTag, item) + } + endList() + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_LIST)) } - endList() - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_LIST)) - } if (optionalList.isPresent) { - val optoptionalList = optionalList.get() - startList(ContextSpecificTag(TAG_OPTIONAL_LIST)) - for (item in optoptionalList.iterator()) { - put(AnonymousTag, item) + val optoptionalList = optionalList.get() + startList(ContextSpecificTag(TAG_OPTIONAL_LIST)) + for (item in optoptionalList.iterator()) { + put(AnonymousTag, item) + } + endList() } - endList() - } if (nullableOptionalList != null) { - if (nullableOptionalList.isPresent) { - val optnullableOptionalList = nullableOptionalList.get() - startList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - for (item in optnullableOptionalList.iterator()) { - put(AnonymousTag, item) + if (nullableOptionalList.isPresent) { + val optnullableOptionalList = nullableOptionalList.get() + startList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + for (item in optnullableOptionalList.iterator()) { + put(AnonymousTag, item) + } + endList() + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) } - endList() - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - } endStructure() } } @@ -157,114 +156,153 @@ class UnitTestingClusterNullablesAndOptionalsStruct ( private const val TAG_OPTIONAL_LIST = 10 private const val TAG_NULLABLE_OPTIONAL_LIST = 11 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterNullablesAndOptionalsStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterNullablesAndOptionalsStruct { tlvReader.enterStructure(tag) - val nullableInt = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_INT)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_INT)) - null - } - val optionalInt = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_INT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_INT))) - } else { - Optional.empty() - } - val nullableOptionalInt = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) - null - } - val nullableString = if (!tlvReader.isNull()) { - tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_STRING)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRING)) - null - } - val optionalString = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRING))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPTIONAL_STRING))) - } else { - Optional.empty() - } - val nullableOptionalString = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) { - Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) - null - } - val nullableStruct = if (!tlvReader.isNull()) { - UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), tlvReader) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) - null - } - val optionalStruct = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRUCT))) { - Optional.of(UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_OPTIONAL_STRUCT), tlvReader)) - } else { - Optional.empty() - } - val nullableOptionalStruct = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT))) { - Optional.of(UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), tlvReader)) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) - null - } - val nullableList = if (!tlvReader.isNull()) { - buildList { - tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_LIST)) - null - } - val optionalList = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_LIST))) { - Optional.of(buildList { - tlvReader.enterList(ContextSpecificTag(TAG_OPTIONAL_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - }) - } else { - Optional.empty() - } - val nullableOptionalList = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST))) { - Optional.of(buildList { - tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - }) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) - null - } - + val nullableInt = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_INT)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_INT)) + null + } + val optionalInt = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_INT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_INT))) + } else { + Optional.empty() + } + val nullableOptionalInt = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_INT)) + null + } + val nullableString = + if (!tlvReader.isNull()) { + tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_STRING)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRING)) + null + } + val optionalString = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRING))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_OPTIONAL_STRING))) + } else { + Optional.empty() + } + val nullableOptionalString = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRING)) + null + } + val nullableStruct = + if (!tlvReader.isNull()) { + UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_NULLABLE_STRUCT), tlvReader) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_STRUCT)) + null + } + val optionalStruct = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_STRUCT))) { + Optional.of( + UnitTestingClusterSimpleStruct.fromTlv( + ContextSpecificTag(TAG_OPTIONAL_STRUCT), + tlvReader + ) + ) + } else { + Optional.empty() + } + val nullableOptionalStruct = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT))) { + Optional.of( + UnitTestingClusterSimpleStruct.fromTlv( + ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT), + tlvReader + ) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_STRUCT)) + null + } + val nullableList = + if (!tlvReader.isNull()) { + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_LIST)) + null + } + val optionalList = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_LIST))) { + Optional.of( + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_OPTIONAL_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + val nullableOptionalList = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST))) { + Optional.of( + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_LIST)) + null + } + tlvReader.exitContainer() - return UnitTestingClusterNullablesAndOptionalsStruct(nullableInt, optionalInt, nullableOptionalInt, nullableString, optionalString, nullableOptionalString, nullableStruct, optionalStruct, nullableOptionalStruct, nullableList, optionalList, nullableOptionalList) + return UnitTestingClusterNullablesAndOptionalsStruct( + nullableInt, + optionalInt, + nullableOptionalInt, + nullableString, + optionalString, + nullableOptionalString, + nullableStruct, + optionalStruct, + nullableOptionalStruct, + nullableList, + optionalList, + nullableOptionalList + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt index 381016bd583fa5..26bf18a07ed214 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt @@ -17,25 +17,22 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterSimpleStruct ( - val a: Int, - val b: Boolean, - val c: Int, - val d: ByteArray, - val e: String, - val f: Int, - val g: Float, - val h: Double) { - override fun toString(): String = buildString { +class UnitTestingClusterSimpleStruct( + val a: Int, + val b: Boolean, + val c: Int, + val d: ByteArray, + val e: String, + val f: Int, + val g: Float, + val h: Double +) { + override fun toString(): String = buildString { append("UnitTestingClusterSimpleStruct {\n") append("\ta : $a\n") append("\tb : $b\n") @@ -73,7 +70,7 @@ class UnitTestingClusterSimpleStruct ( private const val TAG_G = 6 private const val TAG_H = 7 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterSimpleStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterSimpleStruct { tlvReader.enterStructure(tag) val a = tlvReader.getInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) @@ -83,7 +80,7 @@ class UnitTestingClusterSimpleStruct ( val f = tlvReader.getInt(ContextSpecificTag(TAG_F)) val g = tlvReader.getFloat(ContextSpecificTag(TAG_G)) val h = tlvReader.getDouble(ContextSpecificTag(TAG_H)) - + tlvReader.exitContainer() return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt index 8a7b42ba939ae6..6b7273f3172d5d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt @@ -20,22 +20,21 @@ import chip.devicecontroller.cluster.* import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter - import java.util.Optional -class UnitTestingClusterTestFabricScoped ( - val fabricSensitiveInt8u: Int, - val optionalFabricSensitiveInt8u: Optional, - val nullableFabricSensitiveInt8u: Int?, - val nullableOptionalFabricSensitiveInt8u: Optional?, - val fabricSensitiveCharString: String, - val fabricSensitiveStruct: UnitTestingClusterSimpleStruct, - val fabricSensitiveInt8uList: List, - val fabricIndex: Int) { - override fun toString(): String = buildString { +class UnitTestingClusterTestFabricScoped( + val fabricSensitiveInt8u: Int, + val optionalFabricSensitiveInt8u: Optional, + val nullableFabricSensitiveInt8u: Int?, + val nullableOptionalFabricSensitiveInt8u: Optional?, + val fabricSensitiveCharString: String, + val fabricSensitiveStruct: UnitTestingClusterSimpleStruct, + val fabricSensitiveInt8uList: List, + val fabricIndex: Int +) { + override fun toString(): String = buildString { append("UnitTestingClusterTestFabricScoped {\n") append("\tfabricSensitiveInt8u : $fabricSensitiveInt8u\n") append("\toptionalFabricSensitiveInt8u : $optionalFabricSensitiveInt8u\n") @@ -53,22 +52,28 @@ class UnitTestingClusterTestFabricScoped ( startStructure(tag) put(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U), fabricSensitiveInt8u) if (optionalFabricSensitiveInt8u.isPresent) { - val optoptionalFabricSensitiveInt8u = optionalFabricSensitiveInt8u.get() - put(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U), optoptionalFabricSensitiveInt8u) - } + val optoptionalFabricSensitiveInt8u = optionalFabricSensitiveInt8u.get() + put( + ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U), + optoptionalFabricSensitiveInt8u + ) + } if (nullableFabricSensitiveInt8u != null) { - put(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U), nullableFabricSensitiveInt8u) - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) - } + put(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U), nullableFabricSensitiveInt8u) + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) + } if (nullableOptionalFabricSensitiveInt8u != null) { - if (nullableOptionalFabricSensitiveInt8u.isPresent) { - val optnullableOptionalFabricSensitiveInt8u = nullableOptionalFabricSensitiveInt8u.get() - put(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U), optnullableOptionalFabricSensitiveInt8u) - } - } else { - putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) - } + if (nullableOptionalFabricSensitiveInt8u.isPresent) { + val optnullableOptionalFabricSensitiveInt8u = nullableOptionalFabricSensitiveInt8u.get() + put( + ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U), + optnullableOptionalFabricSensitiveInt8u + ) + } + } else { + putNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) + } put(ContextSpecificTag(TAG_FABRIC_SENSITIVE_CHAR_STRING), fabricSensitiveCharString) fabricSensitiveStruct.toTlv(ContextSpecificTag(TAG_FABRIC_SENSITIVE_STRUCT), this) startList(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U_LIST)) @@ -91,44 +96,66 @@ class UnitTestingClusterTestFabricScoped ( private const val TAG_FABRIC_SENSITIVE_INT8U_LIST = 7 private const val TAG_FABRIC_INDEX = 254 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestFabricScoped { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestFabricScoped { tlvReader.enterStructure(tag) val fabricSensitiveInt8u = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U)) - val optionalFabricSensitiveInt8u = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) - } else { - Optional.empty() - } - val nullableFabricSensitiveInt8u = if (!tlvReader.isNull()) { - tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) - null - } - val nullableOptionalFabricSensitiveInt8u = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U))) { - Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U))) - } else { - Optional.empty() - } - } else { - tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) - null - } - val fabricSensitiveCharString = tlvReader.getString(ContextSpecificTag(TAG_FABRIC_SENSITIVE_CHAR_STRING)) - val fabricSensitiveStruct = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_FABRIC_SENSITIVE_STRUCT), tlvReader) - val fabricSensitiveInt8uList = buildList { - tlvReader.enterList(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U_LIST)) - while(!tlvReader.isEndOfContainer()) { - add(tlvReader.getInt(AnonymousTag)) - } - tlvReader.exitContainer() - } + val optionalFabricSensitiveInt8u = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) { + Optional.of(tlvReader.getInt(ContextSpecificTag(TAG_OPTIONAL_FABRIC_SENSITIVE_INT8U))) + } else { + Optional.empty() + } + val nullableFabricSensitiveInt8u = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_FABRIC_SENSITIVE_INT8U)) + null + } + val nullableOptionalFabricSensitiveInt8u = + if (!tlvReader.isNull()) { + if ( + tlvReader.isNextTag(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) + ) { + Optional.of( + tlvReader.getInt(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) + ) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_NULLABLE_OPTIONAL_FABRIC_SENSITIVE_INT8U)) + null + } + val fabricSensitiveCharString = + tlvReader.getString(ContextSpecificTag(TAG_FABRIC_SENSITIVE_CHAR_STRING)) + val fabricSensitiveStruct = + UnitTestingClusterSimpleStruct.fromTlv( + ContextSpecificTag(TAG_FABRIC_SENSITIVE_STRUCT), + tlvReader + ) + val fabricSensitiveInt8uList = + buildList { + tlvReader.enterList(ContextSpecificTag(TAG_FABRIC_SENSITIVE_INT8U_LIST)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getInt(AnonymousTag)) + } + tlvReader.exitContainer() + } val fabricIndex = tlvReader.getInt(ContextSpecificTag(TAG_FABRIC_INDEX)) - + tlvReader.exitContainer() - return UnitTestingClusterTestFabricScoped(fabricSensitiveInt8u, optionalFabricSensitiveInt8u, nullableFabricSensitiveInt8u, nullableOptionalFabricSensitiveInt8u, fabricSensitiveCharString, fabricSensitiveStruct, fabricSensitiveInt8uList, fabricIndex) + return UnitTestingClusterTestFabricScoped( + fabricSensitiveInt8u, + optionalFabricSensitiveInt8u, + nullableFabricSensitiveInt8u, + nullableOptionalFabricSensitiveInt8u, + fabricSensitiveCharString, + fabricSensitiveStruct, + fabricSensitiveInt8uList, + fabricIndex + ) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt index 0540f4f11a30cb..6c5df4cb224166 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UnitTestingClusterTestListStructOctet ( - val member1: Long, - val member2: ByteArray) { - override fun toString(): String = buildString { +class UnitTestingClusterTestListStructOctet(val member1: Long, val member2: ByteArray) { + override fun toString(): String = buildString { append("UnitTestingClusterTestListStructOctet {\n") append("\tmember1 : $member1\n") append("\tmember2 : $member2\n") @@ -49,11 +43,11 @@ class UnitTestingClusterTestListStructOctet ( private const val TAG_MEMBER1 = 0 private const val TAG_MEMBER2 = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UnitTestingClusterTestListStructOctet { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UnitTestingClusterTestListStructOctet { tlvReader.enterStructure(tag) val member1 = tlvReader.getLong(ContextSpecificTag(TAG_MEMBER1)) val member2 = tlvReader.getByteArray(ContextSpecificTag(TAG_MEMBER2)) - + tlvReader.exitContainer() return UnitTestingClusterTestListStructOctet(member1, member2) diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt index 44a824f2303a2e..d90396f2a010ea 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt @@ -17,19 +17,13 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* -import chip.tlv.AnonymousTag import chip.tlv.ContextSpecificTag import chip.tlv.Tag -import chip.tlv.TlvParsingException import chip.tlv.TlvReader import chip.tlv.TlvWriter -import java.util.Optional - -class UserLabelClusterLabelStruct ( - val label: String, - val value: String) { - override fun toString(): String = buildString { +class UserLabelClusterLabelStruct(val label: String, val value: String) { + override fun toString(): String = buildString { append("UserLabelClusterLabelStruct {\n") append("\tlabel : $label\n") append("\tvalue : $value\n") @@ -49,11 +43,11 @@ class UserLabelClusterLabelStruct ( private const val TAG_LABEL = 0 private const val TAG_VALUE = 1 - fun fromTlv(tag: Tag, tlvReader: TlvReader) : UserLabelClusterLabelStruct { + fun fromTlv(tag: Tag, tlvReader: TlvReader): UserLabelClusterLabelStruct { tlvReader.enterStructure(tag) val label = tlvReader.getString(ContextSpecificTag(TAG_LABEL)) val value = tlvReader.getString(ContextSpecificTag(TAG_VALUE)) - + tlvReader.exitContainer() return UserLabelClusterLabelStruct(label, value) From d735b0827e22d79d71ad4f174c40b38c4065a3d0 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 11 Aug 2023 21:22:15 -0400 Subject: [PATCH 05/10] Fix 917 soc builds (#28666) --- examples/platform/silabs/FreeRTOSConfig.h | 4 ++++ examples/platform/silabs/MatterConfig.cpp | 7 ++++--- examples/platform/silabs/MatterConfig.h | 2 +- examples/platform/silabs/SiWx917/BUILD.gn | 7 ++++--- examples/platform/silabs/SiWx917/uart.cpp | 2 +- src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp | 4 ++++ 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/examples/platform/silabs/FreeRTOSConfig.h b/examples/platform/silabs/FreeRTOSConfig.h index 4cad6b1e9803dc..8d3236763f35e6 100644 --- a/examples/platform/silabs/FreeRTOSConfig.h +++ b/examples/platform/silabs/FreeRTOSConfig.h @@ -107,11 +107,15 @@ extern "C" { #include +#ifdef SIWX_917 +extern uint32_t SystemCoreClock; +#else // For EFR32 #include "RTE_Components.h" #include CMSIS_device_header #include "em_assert.h" #include "em_device.h" +#endif #if defined(SL_COMPONENT_CATALOG_PRESENT) #include "sl_component_catalog.h" diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index 1392dd9dc2b382..36f78aa84839c2 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -48,7 +48,7 @@ using namespace ::chip::DeviceLayer; #include // If building with the EFR32-provided crypto backend, we can use the // opaque keystore -#if CHIP_CRYPTO_PLATFORM +#if CHIP_CRYPTO_PLATFORM && !(defined(SIWX_917)) #include static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeystore; #endif @@ -215,7 +215,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName) initParams.testEventTriggerDelegate = &testEventTriggerDelegate; #endif // SILABS_TEST_EVENT_TRIGGER_ENABLED -#if CHIP_CRYPTO_PLATFORM +#if CHIP_CRYPTO_PLATFORM && !(defined(SIWX_917)) // When building with EFR32 crypto, use the opaque key store // instead of the default (insecure) one. gOperationalKeystore.Init(); @@ -255,7 +255,7 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName) } #ifdef SL_WIFI -void SilabsMatterConfig::InitWiFi(void) +CHIP_ERROR SilabsMatterConfig::InitWiFi(void) { #ifdef WF200_WIFI // Start wfx bus communication task. @@ -271,6 +271,7 @@ void SilabsMatterConfig::InitWiFi(void) return CHIP_ERROR_INTERNAL; } #endif /* WF200_WIFI */ + return CHIP_NO_ERROR; } #endif // SL_WIFI diff --git a/examples/platform/silabs/MatterConfig.h b/examples/platform/silabs/MatterConfig.h index 2c565f7caa7321..86c8b7e0a66ba4 100644 --- a/examples/platform/silabs/MatterConfig.h +++ b/examples/platform/silabs/MatterConfig.h @@ -29,7 +29,7 @@ class SilabsMatterConfig private: static CHIP_ERROR InitOpenThread(void); - static void InitWiFi(void); + static CHIP_ERROR InitWiFi(void); static void ConnectivityEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); static void InitOTARequestorHandler(chip::System::Layer * systemLayer, void * appState); }; diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index 3fd6164b576ea1..f0600f012e19e7 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -183,9 +183,10 @@ config("siwx917-common-config") { defines += [ "QR_CODE_ENABLED" ] } - if (chip_enable_ota_requestor) { - defines += [ "SILABS_OTA_ENABLED" ] - } + # TODO: Renable once ota is supported + # if (chip_enable_ota_requestor) { + # defines += [ "SILABS_OTA_ENABLED" ] + # } if (enable_heap_monitoring) { defines += [ "HEAP_MONITORING" ] diff --git a/examples/platform/silabs/SiWx917/uart.cpp b/examples/platform/silabs/SiWx917/uart.cpp index 966fe44d7efd25..ac7bb8af3e774a 100644 --- a/examples/platform/silabs/SiWx917/uart.cpp +++ b/examples/platform/silabs/SiWx917/uart.cpp @@ -53,7 +53,7 @@ void ARM_USART_SignalEvent(uint32_t event) case ARM_USART_EVENT_RECEIVE_COMPLETE: #ifdef ENABLE_CHIP_SHELL chip::NotifyShellProcessFromISR(); -#endif; +#endif case ARM_USART_EVENT_TRANSFER_COMPLETE: case ARM_USART_EVENT_TX_COMPLETE: case ARM_USART_EVENT_TX_UNDERFLOW: diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index f226caeaaa8395..0eba1701c5dec1 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -26,6 +26,10 @@ extern "C" void RSI_Board_LED_Toggle(int); extern "C" void RSI_Wakeupsw_config(void); extern "C" void RSI_Wakeupsw_config_gpio0(void); +#if SILABS_LOG_ENABLED +#include "silabs_utils.h" +#endif + namespace chip { namespace DeviceLayer { namespace Silabs { From 85c09372c9f9387e674fa32ec6038013c74f9b24 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 11 Aug 2023 20:18:46 -0700 Subject: [PATCH 06/10] enable wconversion for matter controller java/jni (#28667) --- src/controller/java/BUILD.gn | 10 ++- .../java/CHIPDeviceController-JNI.cpp | 88 ++++++++++--------- 2 files changed, 54 insertions(+), 44 deletions(-) diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index e967b0bd007936..a2865ffd326c1c 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -104,7 +104,10 @@ shared_library("jni") { deps += [ "${chip_root}/src/platform/Linux" ] } - cflags = [ "-Wno-unknown-pragmas" ] + cflags = [ + "-Wno-unknown-pragmas", + "-Wconversion", + ] output_dir = "${root_out_dir}/lib/jni" } else { @@ -143,7 +146,10 @@ if (chip_link_tests) { deps += [ "${chip_root}/src/platform/Linux" ] } - cflags = [ "-Wno-unknown-pragmas" ] + cflags = [ + "-Wno-unknown-pragmas", + "-Wconversion", + ] output_dir = "${root_out_dir}/lib/jni" } else { diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 64c7dac4774785..5d93b3075a2d8b 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -340,20 +340,21 @@ JNI_METHOD(jlong, newDeviceController)(JNIEnv * env, jobject self, jobject contr SuccessOrExit(err); { - uint64_t fabricId = env->CallLongMethod(controllerParams, getFabricId); - uint16_t listenPort = env->CallIntMethod(controllerParams, getUdpListenPort); - uint16_t controllerVendorId = env->CallIntMethod(controllerParams, getControllerVendorId); + uint64_t fabricId = static_cast(env->CallLongMethod(controllerParams, getFabricId)); + uint16_t listenPort = static_cast(env->CallIntMethod(controllerParams, getUdpListenPort)); + uint16_t controllerVendorId = static_cast(env->CallIntMethod(controllerParams, getControllerVendorId)); jobject keypairDelegate = env->CallObjectMethod(controllerParams, getKeypairDelegate); jbyteArray rootCertificate = (jbyteArray) env->CallObjectMethod(controllerParams, getRootCertificate); jbyteArray intermediateCertificate = (jbyteArray) env->CallObjectMethod(controllerParams, getIntermediateCertificate); jbyteArray operationalCertificate = (jbyteArray) env->CallObjectMethod(controllerParams, getOperationalCertificate); jbyteArray ipk = (jbyteArray) env->CallObjectMethod(controllerParams, getIpk); - uint16_t failsafeTimerSeconds = env->CallIntMethod(controllerParams, getFailsafeTimerSeconds); - uint16_t caseFailsafeTimerSeconds = env->CallIntMethod(controllerParams, getCASEFailsafeTimerSeconds); + uint16_t failsafeTimerSeconds = static_cast(env->CallIntMethod(controllerParams, getFailsafeTimerSeconds)); + uint16_t caseFailsafeTimerSeconds = + static_cast(env->CallIntMethod(controllerParams, getCASEFailsafeTimerSeconds)); bool attemptNetworkScanWiFi = env->CallBooleanMethod(controllerParams, getAttemptNetworkScanWiFi); bool attemptNetworkScanThread = env->CallBooleanMethod(controllerParams, getAttemptNetworkScanThread); bool skipCommissioningComplete = env->CallBooleanMethod(controllerParams, getSkipCommissioningComplete); - uint64_t adminSubject = env->CallLongMethod(controllerParams, getAdminSubject); + uint64_t adminSubject = static_cast(env->CallLongMethod(controllerParams, getAdminSubject)); jobject countryCodeOptional = env->CallObjectMethod(controllerParams, getCountryCode); jobject regulatoryLocationOptional = env->CallObjectMethod(controllerParams, getRegulatoryLocation); @@ -630,9 +631,9 @@ JNI_METHOD(void, pairDeviceWithAddress) RendezvousParameters rendezvousParams = RendezvousParameters() - .SetDiscriminator(discriminator) + .SetDiscriminator(static_cast(discriminator)) .SetSetupPINCode(static_cast(pinCode)) - .SetPeerAddress(Transport::PeerAddress::UDP(const_cast(addrJniString.c_str()), port)); + .SetPeerAddress(Transport::PeerAddress::UDP(const_cast(addrJniString.c_str()), static_cast(port))); CommissioningParameters commissioningParams = wrapper->GetCommissioningParameters(); if (csrNonce != nullptr) @@ -748,7 +749,7 @@ JNI_METHOD(void, establishPaseConnectionByAddress) RendezvousParameters rendezvousParams = RendezvousParameters() .SetSetupPINCode(static_cast(pinCode)) - .SetPeerAddress(Transport::PeerAddress::UDP(const_cast(addrJniString.c_str()), port)); + .SetPeerAddress(Transport::PeerAddress::UDP(const_cast(addrJniString.c_str()), static_cast(port))); err = wrapper->Controller()->EstablishPASEConnection(deviceId, rendezvousParams); @@ -871,7 +872,7 @@ CHIP_ERROR GetEpochTime(JNIEnv * env, jobject calendar, uint32_t & epochTime) universalTime.Year = static_cast(env->CallIntMethod(calendar, getMethod, yearID)); // The first month of the year in the Gregorian and Julian calendars is JANUARY which is 0. See detailed in // https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#MONTH - universalTime.Month = static_cast(env->CallIntMethod(calendar, getMethod, monthID)) + 1; + universalTime.Month = static_cast(static_cast(env->CallIntMethod(calendar, getMethod, monthID)) + 1u); universalTime.Day = static_cast(env->CallIntMethod(calendar, getMethod, dayID)); universalTime.Hour = static_cast(env->CallIntMethod(calendar, getMethod, hourID)); universalTime.Minute = static_cast(env->CallIntMethod(calendar, getMethod, minuteID)); @@ -1505,7 +1506,7 @@ JNI_METHOD(jboolean, openPairingWindowWithPIN) chip::SetupPayload setupPayload; err = AutoCommissioningWindowOpener::OpenCommissioningWindow( wrapper->Controller(), chipDevice->GetDeviceId(), System::Clock::Seconds16(duration), static_cast(iteration), - discriminator, pinCode, NullOptional, setupPayload); + static_cast(discriminator), pinCode, NullOptional, setupPayload); if (err != CHIP_NO_ERROR) { @@ -1571,7 +1572,7 @@ JNI_METHOD(jboolean, openPairingWindowWithPINCallback) chip::SetupPayload setupPayload; err = AndroidCommissioningWindowOpener::OpenCommissioningWindow( wrapper->Controller(), chipDevice->GetDeviceId(), System::Clock::Seconds16(duration), static_cast(iteration), - discriminator, pinCode, NullOptional, jcallback, setupPayload); + static_cast(discriminator), pinCode, NullOptional, jcallback, setupPayload); if (err != CHIP_NO_ERROR) { @@ -1699,11 +1700,12 @@ JNI_METHOD(void, subscribe) } app::ReadPrepareParams params(device->GetSecureSession().Value()); - params.mMinIntervalFloorSeconds = minInterval; - params.mMaxIntervalCeilingSeconds = maxInterval; + uint16_t aImTimeoutMs = static_cast(imTimeoutMs); + params.mMinIntervalFloorSeconds = static_cast(minInterval); + params.mMaxIntervalCeilingSeconds = static_cast(maxInterval); params.mKeepSubscriptions = (keepSubscriptions != JNI_FALSE); params.mIsFabricFiltered = (isFabricFiltered != JNI_FALSE); - params.mTimeout = imTimeoutMs != 0 ? System::Clock::Milliseconds32(imTimeoutMs) : System::Clock::kZero; + params.mTimeout = aImTimeoutMs != 0 ? System::Clock::Milliseconds32(aImTimeoutMs) : System::Clock::kZero; if (attributePathList != nullptr) { @@ -1857,10 +1859,11 @@ JNI_METHOD(void, write) jint imTimeoutMs) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - jint listSize = 0; - auto callback = reinterpret_cast(callbackHandle); - app::WriteClient * writeClient; + CHIP_ERROR err = CHIP_NO_ERROR; + jint listSize = 0; + auto callback = reinterpret_cast(callbackHandle); + app::WriteClient * writeClient = nullptr; + uint16_t convertedTimedRequestTimeoutMs = static_cast(timedRequestTimeoutMs); ChipLogDetail(Controller, "IM write() called"); @@ -1870,9 +1873,9 @@ JNI_METHOD(void, write) VerifyOrExit(attributeList != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); SuccessOrExit(err = JniReferences::GetInstance().GetListSize(attributeList, listSize)); - writeClient = Platform::New(device->GetExchangeManager(), callback->GetChunkedWriteCallback(), - timedRequestTimeoutMs != 0 ? Optional(timedRequestTimeoutMs) - : Optional::Missing()); + writeClient = Platform::New( + device->GetExchangeManager(), callback->GetChunkedWriteCallback(), + convertedTimedRequestTimeoutMs != 0 ? Optional(convertedTimedRequestTimeoutMs) : Optional::Missing()); for (uint8_t i = 0; i < listSize; i++) { @@ -1987,24 +1990,25 @@ JNI_METHOD(void, invoke) jint imTimeoutMs) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - auto callback = reinterpret_cast(callbackHandle); - app::CommandSender * commandSender; - uint32_t endpointId = 0; - uint32_t clusterId = 0; - uint32_t commandId = 0; - jmethodID getEndpointIdMethod = nullptr; - jmethodID getClusterIdMethod = nullptr; - jmethodID getCommandIdMethod = nullptr; - jmethodID getTlvByteArrayMethod = nullptr; - jobject endpointIdObj = nullptr; - jobject clusterIdObj = nullptr; - jobject commandIdObj = nullptr; - jbyteArray tlvBytesObj = nullptr; - jbyte * tlvBytesObjBytes = nullptr; - jsize length = 0; + CHIP_ERROR err = CHIP_NO_ERROR; + auto callback = reinterpret_cast(callbackHandle); + app::CommandSender * commandSender = nullptr; + uint32_t endpointId = 0; + uint32_t clusterId = 0; + uint32_t commandId = 0; + jmethodID getEndpointIdMethod = nullptr; + jmethodID getClusterIdMethod = nullptr; + jmethodID getCommandIdMethod = nullptr; + jmethodID getTlvByteArrayMethod = nullptr; + jobject endpointIdObj = nullptr; + jobject clusterIdObj = nullptr; + jobject commandIdObj = nullptr; + jbyteArray tlvBytesObj = nullptr; + jbyte * tlvBytesObjBytes = nullptr; + jsize length = 0; TLV::TLVReader reader; - TLV::TLVWriter * writer = nullptr; + TLV::TLVWriter * writer = nullptr; + uint16_t convertedTimedRequestTimeoutMs = static_cast(timedRequestTimeoutMs); ChipLogDetail(Controller, "IM invoke() called"); @@ -2058,9 +2062,9 @@ JNI_METHOD(void, invoke) reader.Init(reinterpret_cast(tlvBytesObjBytes), static_cast(length)); reader.Next(); SuccessOrExit(err = writer->CopyContainer(TLV::ContextTag(app::CommandDataIB::Tag::kFields), reader)); - - SuccessOrExit(err = commandSender->FinishCommand(timedRequestTimeoutMs != 0 ? Optional(timedRequestTimeoutMs) - : Optional::Missing())); + SuccessOrExit(err = commandSender->FinishCommand(convertedTimedRequestTimeoutMs != 0 + ? Optional(convertedTimedRequestTimeoutMs) + : Optional::Missing())); SuccessOrExit(err = commandSender->SendCommandRequest(device->GetSecureSession().Value(), From 1309e7d51f434d1954ab244562a8db6a01e87662 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 11 Aug 2023 23:20:40 -0400 Subject: [PATCH 07/10] [Silabs]Always print in logs the QR code unconditionnally of the LCD presence (#28663) * Always print the qr code payload and url to the console at init and on pb0 press * Restyled by whitespace --------- Co-authored-by: Restyled.io --- examples/platform/silabs/BaseApplication.cpp | 47 ++++++++++++-------- examples/platform/silabs/BaseApplication.h | 9 ++++ 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index b0d1dd0ea8a414..cd37c4615fa4bb 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -222,24 +222,7 @@ CHIP_ERROR BaseApplication::Init() ConfigurationMgr().LogDeviceConfig(); - // Create buffer for QR code that can fit max size and null terminator. - char qrCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; - chip::MutableCharSpan QRCode(qrCodeBuffer); - - if (Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider().GetSetupPayload(QRCode) == CHIP_NO_ERROR) - { - // Print setup info on LCD if available -#ifdef QR_CODE_ENABLED - slLCD.SetQRCode((uint8_t *) QRCode.data(), QRCode.size()); - slLCD.ShowQRCode(true, true); -#else - PrintQrCodeURL(QRCode); -#endif // QR_CODE_ENABLED - } - else - { - SILABS_LOG("Getting QR code failed!"); - } + OutputQrCode(true /*refreshLCD at init*/); PlatformMgr().AddEventHandler(OnPlatformEvent, 0); #ifdef SL_WIFI @@ -457,6 +440,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) CancelFunctionTimer(); mFunction = kFunction_NoneSelected; + OutputQrCode(false); #ifdef QR_CODE_ENABLED // TOGGLE QRCode/LCD demo UI slLCD.ToggleQRCode(); @@ -700,3 +684,30 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t) sIsProvisioned = event->ServiceProvisioningChange.IsServiceProvisioned; } } + +void BaseApplication::OutputQrCode(bool refreshLCD) +{ + (void) refreshLCD; // could be unused + + // Create buffer for the Qr code setup payload that can fit max size and null terminator. + char setupPayloadBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; + chip::MutableCharSpan setupPayload(setupPayloadBuffer); + + if (Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider().GetSetupPayload(setupPayload) == CHIP_NO_ERROR) + { + // Print setup info on LCD if available +#ifdef QR_CODE_ENABLED + if (refreshLCD) + { + slLCD.SetQRCode((uint8_t *) setupPayload.data(), setupPayload.size()); + slLCD.ShowQRCode(true, true); + } +#endif // QR_CODE_ENABLED + + PrintQrCodeURL(setupPayload); + } + else + { + SILABS_LOG("Getting QR code failed!"); + } +} diff --git a/examples/platform/silabs/BaseApplication.h b/examples/platform/silabs/BaseApplication.h index 9e99580811293c..b3a9db893183e5 100644 --- a/examples/platform/silabs/BaseApplication.h +++ b/examples/platform/silabs/BaseApplication.h @@ -202,6 +202,15 @@ class BaseApplication static void ScheduleFactoryReset(); static void OnPlatformEvent(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t); + + /** + * @brief Outputs the QRcode payload and URL to the QR code in the logs + * and conditionally on the device LCD. + * + * @param refreshLCD When true, The LCD of the device will be refreshed to show the QR code + */ + static void OutputQrCode(bool refreshLCD); + /********************************************************** * Protected Attributes declaration *********************************************************/ From b0b0d582fb579a1ceb0a4982b2295abb80d5d37a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 12 Aug 2023 04:28:11 -0400 Subject: [PATCH 08/10] Add missing locks around nodeIDToDeviceMap access. (#28675) Those accesses are all supposed to happen while holding _deviceMapLock, but we had some that were not locking. --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index cf4ab4c068d465..21ec9e56f737e9 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -163,11 +163,17 @@ - (void)cleanupAfterStartup { // Invalidate our MTRDevice instances before we shut down our secure // sessions and whatnot, so they don't start trying to resubscribe when we - // do the secure session shutdowns. - for (MTRDevice * device in [self.nodeIDToDeviceMap allValues]) { + // do the secure session shutdowns. Since we don't want to hold the lock + // while calling out into arbitrary invalidation code, snapshot the list of + // devices before we start invalidating. + os_unfair_lock_lock(&_deviceMapLock); + NSArray * devices = [self.nodeIDToDeviceMap allValues]; + [self.nodeIDToDeviceMap removeAllObjects]; + os_unfair_lock_unlock(&_deviceMapLock); + + for (MTRDevice * device in devices) { [device invalidate]; } - [self.nodeIDToDeviceMap removeAllObjects]; [self stopBrowseForCommissionables]; [_factory controllerShuttingDown:self]; From bd2985f6a398ca8100b54642f19714027eb624ce Mon Sep 17 00:00:00 2001 From: Rohit Jadhav <69809379+jadhavrohit924@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:15:28 +0530 Subject: [PATCH 09/10] [ESP32]: Add way to configure BLE scan response. (#28571) * [ESP32]: Add way to configure scan response. * Restyled by prettier-markdown * Address review comments --------- Co-authored-by: Restyled.io --- docs/guides/esp32/README.md | 1 + docs/guides/esp32/ble_settings.md | 32 ++++++++++++++++++++ src/platform/ESP32/BLEManagerImpl.h | 8 +++++ src/platform/ESP32/nimble/BLEManagerImpl.cpp | 28 +++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 docs/guides/esp32/ble_settings.md diff --git a/docs/guides/esp32/README.md b/docs/guides/esp32/README.md index 89d9225cf65dd8..e487a58f318591 100644 --- a/docs/guides/esp32/README.md +++ b/docs/guides/esp32/README.md @@ -17,3 +17,4 @@ example on ESP32 series of SoCs - [RPC Console and Device Tracing](rpc_console.md) - [Matter OTA](ota.md) - [Generating and Using ESP Secure Cert Partition](secure_cert_partition.md) +- [BLE Settings](ble_settings.md) diff --git a/docs/guides/esp32/ble_settings.md b/docs/guides/esp32/ble_settings.md new file mode 100644 index 00000000000000..36178ebece5d71 --- /dev/null +++ b/docs/guides/esp32/ble_settings.md @@ -0,0 +1,32 @@ +# Bluetooth Low Energy (BLE) + +## Nimble: scan response + +The `ConfigureScanResponseData` API is used to configure the scan response data +for advertising in a Bluetooth Low Energy (BLE) application based on the NimBLE +BLE stack. Scan response data is additional data that a BLE peripheral device +can include in its advertising packets to provide more information about itself. +This API allows you to set the scan response data that will be included in the +advertising packets. + +### Usage + +``` +{ + uint8_t scanResponse[31]; // 0x05, 0x09, a, b, c, d + scanResponse[0] = 0x05; + scanResponse[1] = 0x09; + scanResponse[2] = 0x61; + scanResponse[3] = 0x62; + scanResponse[4] = 0x63; + scanResponse[5] = 0x64; + chip::ByteSpan data(scanResponse); + CHIP_ERROR err = chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureScanResponseData(data); + if (err != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "Failed to configure scan response, err:%" CHIP_ERROR_FORMAT, err.Format()); + } +} +``` + +Note: Scan response should be configure before `InitServer`. diff --git a/src/platform/ESP32/BLEManagerImpl.h b/src/platform/ESP32/BLEManagerImpl.h index e7f61785ffa5c8..5cb1421750786a 100644 --- a/src/platform/ESP32/BLEManagerImpl.h +++ b/src/platform/ESP32/BLEManagerImpl.h @@ -71,6 +71,8 @@ struct ble_gatt_char_context #include #endif +#define MAX_SCAN_RSP_DATA_LEN 31 + namespace chip { namespace DeviceLayer { namespace Internal { @@ -132,6 +134,7 @@ class BLEManagerImpl final : public BLEManager, #endif { public: + uint8_t scanResponseBuffer[MAX_SCAN_RSP_DATA_LEN]; BLEManagerImpl() {} #if CONFIG_ENABLE_ESP32_BLE_CONTROLLER CHIP_ERROR ConfigureBle(uint32_t aAdapterId, bool aIsCentral); @@ -140,7 +143,12 @@ class BLEManagerImpl final : public BLEManager, #endif #endif + CHIP_ERROR ConfigureScanResponseData(ByteSpan data); + void ClearScanResponseData(void); + private: + chip::Optional mScanResponse; + // Allow the BLEManager interface class to delegate method calls to // the implementation methods provided by this class. friend BLEManager; diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 52e86d4b050a7f..6a9a047ab84db1 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -1012,6 +1012,25 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) return err; } +CHIP_ERROR BLEManagerImpl::ConfigureScanResponseData(ByteSpan data) +{ + if (!IsSpanUsable(data) || data.size() > MAX_SCAN_RSP_DATA_LEN) + { + ChipLogError(DeviceLayer, "scan response data is invalid"); + return CHIP_ERROR_INVALID_ARGUMENT; + } + memcpy(scanResponseBuffer, data.data(), data.size()); + ByteSpan scanResponseSpan(scanResponseBuffer); + mScanResponse = chip::Optional(scanResponseSpan); + return CHIP_NO_ERROR; +} + +void BLEManagerImpl::ClearScanResponseData(void) +{ + mScanResponse.ClearValue(); + ChipLogDetail(DeviceLayer, "scan response data is cleared"); +} + void BLEManagerImpl::HandleRXCharWrite(struct ble_gatt_char_context * param) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -1584,6 +1603,15 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) } } #endif + if (mScanResponse.HasValue()) + { + err = MapBLEError(ble_gap_adv_rsp_set_data(mScanResponse.Value().data(), mScanResponse.Value().size())); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "ble_gap_adv_rsp_set_data failed: %s", ErrorStr(err)); + return err; + } + } err = MapBLEError(ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER, &adv_params, ble_svr_gap_event, NULL)); if (err == CHIP_NO_ERROR) { From 3c3e5f52ddb7b73bee4ca3c0d9f4584ddd98dced Mon Sep 17 00:00:00 2001 From: Michael Rupp <95718139+mykrupp@users.noreply.github.com> Date: Mon, 14 Aug 2023 10:11:08 -0400 Subject: [PATCH 10/10] [Silabs] Update lock app to send correct lock operation event (#28660) * fix lock operation event * remove MakeNullable include * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../lock-app/silabs/include/LockManager.h | 12 ++++++---- examples/lock-app/silabs/src/AppTask.cpp | 4 +--- examples/lock-app/silabs/src/LockManager.cpp | 24 ++++++++++++------- examples/lock-app/silabs/src/ZclCallbacks.cpp | 6 ++--- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/examples/lock-app/silabs/include/LockManager.h b/examples/lock-app/silabs/include/LockManager.h index 901dfdbd06cb04..9adcc863f0aec7 100644 --- a/examples/lock-app/silabs/include/LockManager.h +++ b/examples/lock-app/silabs/include/LockManager.h @@ -143,9 +143,12 @@ class LockManager typedef void (*Callback_fn_completed)(Action_t); void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); - bool Lock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err); - bool Unlock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err); - bool Unbolt(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err); + bool Lock(chip::EndpointId endpointId, const Nullable & fabricIdx, const Nullable & nodeId, + const Optional & pin, OperationErrorEnum & err); + bool Unlock(chip::EndpointId endpointId, const Nullable & fabricIdx, const Nullable & nodeId, + const Optional & pin, OperationErrorEnum & err); + bool Unbolt(chip::EndpointId endpointId, const Nullable & fabricIdx, const Nullable & nodeId, + const Optional & pin, OperationErrorEnum & err); bool GetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user); bool SetUser(chip::EndpointId endpointId, uint16_t userIndex, chip::FabricIndex creator, chip::FabricIndex modifier, @@ -183,7 +186,8 @@ class LockManager bool IsValidYeardayScheduleIndex(uint8_t scheduleIndex); bool IsValidHolidayScheduleIndex(uint8_t scheduleIndex); - bool setLockState(chip::EndpointId endpointId, DlLockState lockState, const Optional & pin, + bool setLockState(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, DlLockState lockState, const Optional & pin, OperationErrorEnum & err); const char * lockStateToString(DlLockState lockState) const; diff --git a/examples/lock-app/silabs/src/AppTask.cpp b/examples/lock-app/silabs/src/AppTask.cpp index 8afe7d6cc8d9e5..7d86fec80a07d9 100644 --- a/examples/lock-app/silabs/src/AppTask.cpp +++ b/examples/lock-app/silabs/src/AppTask.cpp @@ -352,11 +352,9 @@ void AppTask::UpdateClusterState(intptr_t context) bool unlocked = LockMgr().NextState(); DlLockState newState = unlocked ? DlLockState::kUnlocked : DlLockState::kLocked; - OperationSourceEnum source = OperationSourceEnum::kUnspecified; - // write the new lock value EmberAfStatus status = - DoorLockServer::Instance().SetLockState(1, newState, source) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; + DoorLockServer::Instance().SetLockState(1, newState) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; if (status != EMBER_ZCL_STATUS_SUCCESS) { diff --git a/examples/lock-app/silabs/src/LockManager.cpp b/examples/lock-app/silabs/src/LockManager.cpp index f3c6dfe748ca35..8190dbddd6141e 100644 --- a/examples/lock-app/silabs/src/LockManager.cpp +++ b/examples/lock-app/silabs/src/LockManager.cpp @@ -288,19 +288,22 @@ void LockManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) } } -bool LockManager::Lock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err) +bool LockManager::Lock(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pin, OperationErrorEnum & err) { - return setLockState(endpointId, DlLockState::kLocked, pin, err); + return setLockState(endpointId, fabricIdx, nodeId, DlLockState::kLocked, pin, err); } -bool LockManager::Unlock(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err) +bool LockManager::Unlock(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pin, OperationErrorEnum & err) { - return setLockState(endpointId, DlLockState::kUnlocked, pin, err); + return setLockState(endpointId, fabricIdx, nodeId, DlLockState::kUnlocked, pin, err); } -bool LockManager::Unbolt(chip::EndpointId endpointId, const Optional & pin, OperationErrorEnum & err) +bool LockManager::Unbolt(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, const Optional & pin, OperationErrorEnum & err) { - return setLockState(endpointId, DlLockState::kUnlocked, pin, err); + return setLockState(endpointId, fabricIdx, nodeId, DlLockState::kUnlocked, pin, err); } bool LockManager::GetUser(chip::EndpointId endpointId, uint16_t userIndex, EmberAfPluginDoorLockUserInfo & user) @@ -664,7 +667,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Unknown"; } -bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockState, const Optional & pin, +bool LockManager::setLockState(chip::EndpointId endpointId, const Nullable & fabricIdx, + const Nullable & nodeId, DlLockState lockState, const Optional & pin, OperationErrorEnum & err) { @@ -683,7 +687,8 @@ bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockStat ChipLogDetail(Zcl, "Door Lock App: setting door lock state to \"%s\" [endpointId=%d]", lockStateToString(lockState), endpointId); - DoorLockServer::Instance().SetLockState(endpointId, lockState); + DoorLockServer::Instance().SetLockState(endpointId, lockState, OperationSourceEnum::kRemote, NullNullable, NullNullable, + fabricIdx, nodeId); return true; } @@ -708,7 +713,8 @@ bool LockManager::setLockState(chip::EndpointId endpointId, DlLockState lockStat "Lock App: specified PIN code was found in the database, setting lock state to \"%s\" [endpointId=%d]", lockStateToString(lockState), endpointId); - DoorLockServer::Instance().SetLockState(endpointId, lockState); + DoorLockServer::Instance().SetLockState(endpointId, lockState, OperationSourceEnum::kRemote, NullNullable, NullNullable, + fabricIdx, nodeId); return true; } diff --git a/examples/lock-app/silabs/src/ZclCallbacks.cpp b/examples/lock-app/silabs/src/ZclCallbacks.cpp index dc5d60915218ae..12649100df5737 100644 --- a/examples/lock-app/silabs/src/ZclCallbacks.cpp +++ b/examples/lock-app/silabs/src/ZclCallbacks.cpp @@ -66,7 +66,7 @@ bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const N OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Lock Command endpoint=%d", endpointId); - bool status = LockMgr().Lock(endpointId, pinCode, err); + bool status = LockMgr().Lock(endpointId, fabricIdx, nodeId, pinCode, err); if (status == true) { LockMgr().InitiateAction(AppEvent::kEventType_Lock, LockManager::LOCK_ACTION); @@ -79,7 +79,7 @@ bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unlock Command endpoint=%d", endpointId); - bool status = LockMgr().Unlock(endpointId, pinCode, err); + bool status = LockMgr().Unlock(endpointId, fabricIdx, nodeId, pinCode, err); if (status == true) { LockMgr().InitiateAction(AppEvent::kEventType_Lock, LockManager::UNLOCK_ACTION); @@ -93,7 +93,7 @@ bool emberAfPluginDoorLockOnDoorUnboltCommand(chip::EndpointId endpointId, const OperationErrorEnum & err) { ChipLogProgress(Zcl, "Door Lock App: Unbolt Command endpoint=%d", endpointId); - bool status = LockMgr().Unlock(endpointId, pinCode, err); + bool status = LockMgr().Unlock(endpointId, fabricIdx, nodeId, pinCode, err); if (status == true) { LockMgr().InitiateAction(AppEvent::kEventType_Lock, LockManager::UNLOCK_ACTION);