From 8d2516a3ca846e54f1af8e0c0f63488790fa441a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 14 Jun 2023 12:15:18 -0400 Subject: [PATCH 01/31] Do proper ACL checks on event reads/subscriptions. (#26761) * Do proper ACL checks on event reads/subscriptions. This adds the following functionality: 1. We now correctly detect subsciptions that don't have any access to anything, even if they have an event path in the subscribe request. For paths with a wildcard event id, this check assumes read privileges are needed when event lists are disabled, and uses the actual event-specific privileges when event lists are enabled. 2. When doing reads of an unsupported event, correctly return an errors instead of an empty event list. 3. Fix various unit test mocks to provide the information needed for the new checks. 4. Update expectation in existing YAML test that was checking an "unimplemented event" case. * Address review comments. * Fix darwin build. * Fix Darwin tests, now that we get errors for unsupported events. * Move function declarations to a non-codegen-dependent header. * Handle ACL checks for event wildcards even if we have no EventList. * Update to spec change for unsupported event errors. * Address review comments. --- src/app/InteractionModelEngine.cpp | 176 ++++++++++++++++-- src/app/InteractionModelEngine.h | 21 ++- src/app/reporting/Engine.cpp | 20 +- src/app/tests/TestAclAttribute.cpp | 12 ++ src/app/tests/TestReadInteraction.cpp | 78 ++++---- .../tests/integration/chip_im_initiator.cpp | 6 + .../tests/integration/chip_im_responder.cpp | 7 + src/app/tests/suites/TestEvents.yaml | 3 +- src/app/util/af.h | 17 +- src/app/util/attribute-storage.h | 8 +- .../util/ember-compatibility-functions.cpp | 38 +++- src/app/util/endpoint-config-api.h | 67 +++++++ src/app/util/mock/attribute-storage.cpp | 65 ++++++- src/app/util/util.h | 3 +- src/controller/tests/data_model/TestRead.cpp | 7 + src/darwin/Framework/CHIP/MTRIMDispatch.mm | 45 +++++ .../Framework/CHIPTests/MTRDeviceTests.m | 79 ++++---- .../chip-tool/zap-generated/test/Commands.h | 6 +- 18 files changed, 535 insertions(+), 123 deletions(-) create mode 100644 src/app/util/endpoint-config-api.h diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index e48a4ef4330b6d..6c32952135c902 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -30,11 +30,11 @@ #include "access/RequestPath.h" #include "access/SubjectDescriptor.h" #include +#include +#include #include #include -extern bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId); - namespace chip { namespace app { @@ -351,10 +351,8 @@ CHIP_ERROR InteractionModelEngine::ParseAttributePaths(const Access::SubjectDesc aHasValidAttributePath = false; aRequestedAttributePathCount = 0; - while (CHIP_NO_ERROR == (err = pathReader.Next())) + while (CHIP_NO_ERROR == (err = pathReader.Next(TLV::AnonymousTag()))) { - VerifyOrReturnError(TLV::AnonymousTag() == pathReader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); - AttributePathIB::Parser path; // // We create an iterator to point to a single item object list that tracks the path we just parsed. @@ -413,6 +411,152 @@ CHIP_ERROR InteractionModelEngine::ParseAttributePaths(const Access::SubjectDesc return err; } +static bool CanAccess(const Access::SubjectDescriptor & aSubjectDescriptor, const ConcreteClusterPath & aPath, + Access::Privilege aNeededPrivilege) +{ + Access::RequestPath requestPath{ .cluster = aPath.mClusterId, .endpoint = aPath.mEndpointId }; + CHIP_ERROR err = Access::GetAccessControl().Check(aSubjectDescriptor, requestPath, aNeededPrivilege); + return (err == CHIP_NO_ERROR); +} + +static bool CanAccess(const Access::SubjectDescriptor & aSubjectDescriptor, const ConcreteEventPath & aPath) +{ + return CanAccess(aSubjectDescriptor, aPath, RequiredPrivilege::ForReadEvent(aPath)); +} + +/** + * Helper to handle wildcard events in the event path. + */ +static bool HasValidEventPathForEndpointAndCluster(EndpointId aEndpoint, const EmberAfCluster * aCluster, + const EventPathParams & aEventPath, + const Access::SubjectDescriptor & aSubjectDescriptor) +{ + if (aEventPath.HasWildcardEventId()) + { +#if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE + for (decltype(aCluster->eventCount) idx = 0; idx > aCluster->eventCount; ++idx) + { + ConcreteEventPath path(aEndpoint, aCluster->clusterId, aCluster->eventList[idx]); + // If we get here, the path exists. We just have to do an ACL check for it. + bool isValid = CanAccess(aSubjectDescriptor, path); + if (isValid) + { + return true; + } + } + + return false; +#else + // We have no way to expand wildcards. Just assume that we would need + // View permissions for whatever events are involved. + ConcreteClusterPath clusterPath(aEndpoint, aCluster->clusterId); + return CanAccess(aSubjectDescriptor, clusterPath, Access::Privilege::kView); +#endif + } + + ConcreteEventPath path(aEndpoint, aCluster->clusterId, aEventPath.mEventId); + if (CheckEventSupportStatus(path) != Status::Success) + { + // Not an existing event path. + return false; + } + return CanAccess(aSubjectDescriptor, path); +} + +/** + * Helper to handle wildcard clusters in the event path. + */ +static bool HasValidEventPathForEndpoint(EndpointId aEndpoint, const EventPathParams & aEventPath, + const Access::SubjectDescriptor & aSubjectDescriptor) +{ + if (aEventPath.HasWildcardClusterId()) + { + auto * endpointType = emberAfFindEndpointType(aEndpoint); + if (endpointType == nullptr) + { + // Not going to have any valid paths in here. + return false; + } + + for (decltype(endpointType->clusterCount) idx = 0; idx < endpointType->clusterCount; ++idx) + { + bool hasValidPath = + HasValidEventPathForEndpointAndCluster(aEndpoint, &endpointType->cluster[idx], aEventPath, aSubjectDescriptor); + if (hasValidPath) + { + return true; + } + } + + return false; + } + + auto * cluster = emberAfFindServerCluster(aEndpoint, aEventPath.mClusterId); + if (cluster == nullptr) + { + // Nothing valid here. + return false; + } + return HasValidEventPathForEndpointAndCluster(aEndpoint, cluster, aEventPath, aSubjectDescriptor); +} + +CHIP_ERROR InteractionModelEngine::ParseEventPaths(const Access::SubjectDescriptor & aSubjectDescriptor, + EventPathIBs::Parser & aEventPathListParser, bool & aHasValidEventPath, + size_t & aRequestedEventPathCount) +{ + TLV::TLVReader pathReader; + aEventPathListParser.GetReader(&pathReader); + CHIP_ERROR err = CHIP_NO_ERROR; + + aHasValidEventPath = false; + aRequestedEventPathCount = 0; + + while (CHIP_NO_ERROR == (err = pathReader.Next(TLV::AnonymousTag()))) + { + EventPathIB::Parser path; + ReturnErrorOnFailure(path.Init(pathReader)); + + EventPathParams eventPath; + ReturnErrorOnFailure(path.ParsePath(eventPath)); + + ++aRequestedEventPathCount; + + if (aHasValidEventPath) + { + // Can skip all the rest of the checking. + continue; + } + + // The definition of "valid path" is "path exists and ACL allows + // access". We need to do some expansion of wildcards to handle that. + if (eventPath.HasWildcardEndpointId()) + { + for (uint16_t endpointIndex = 0; !aHasValidEventPath && endpointIndex < emberAfEndpointCount(); ++endpointIndex) + { + if (!emberAfEndpointIndexIsEnabled(endpointIndex)) + { + continue; + } + aHasValidEventPath = + HasValidEventPathForEndpoint(emberAfEndpointFromIndex(endpointIndex), eventPath, aSubjectDescriptor); + } + } + else + { + // No need to check whether the endpoint is enabled, because + // emberAfFindEndpointType returns null for disabled endpoints. + aHasValidEventPath = HasValidEventPathForEndpoint(eventPath.mEndpointId, eventPath, aSubjectDescriptor); + } + } + + if (err == CHIP_ERROR_END_OF_TLV) + { + err = CHIP_NO_ERROR; + } + + return err; +} + Protocols::InteractionModel::Status InteractionModelEngine::OnReadInitialRequest(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload, @@ -472,6 +616,7 @@ Protocols::InteractionModel::Status InteractionModelEngine::OnReadInitialRequest size_t requestedEventPathCount = 0; AttributePathIBs::Parser attributePathListParser; bool hasValidAttributePath = false; + bool hasValidEventPath = false; CHIP_ERROR err = subscribeRequestParser.GetAttributeRequests(&attributePathListParser); if (err == CHIP_NO_ERROR) @@ -489,14 +634,16 @@ Protocols::InteractionModel::Status InteractionModelEngine::OnReadInitialRequest return Status::InvalidAction; } - EventPathIBs::Parser eventpathListParser; - err = subscribeRequestParser.GetEventRequests(&eventpathListParser); + EventPathIBs::Parser eventPathListParser; + err = subscribeRequestParser.GetEventRequests(&eventPathListParser); if (err == CHIP_NO_ERROR) { - TLV::TLVReader pathReader; - eventpathListParser.GetReader(&pathReader); - ReturnErrorCodeIf(TLV::Utilities::Count(pathReader, requestedEventPathCount, false) != CHIP_NO_ERROR, - Status::InvalidAction); + auto subjectDescriptor = apExchangeContext->GetSessionHandle()->AsSecureSession()->GetSubjectDescriptor(); + err = ParseEventPaths(subjectDescriptor, eventPathListParser, hasValidEventPath, requestedEventPathCount); + if (err != CHIP_NO_ERROR) + { + return Status::InvalidAction; + } } else if (err != CHIP_ERROR_END_OF_TLV) { @@ -512,12 +659,7 @@ Protocols::InteractionModel::Status InteractionModelEngine::OnReadInitialRequest return Status::InvalidAction; } - // - // TODO: We don't have an easy way to do a similar 'path expansion' for events to deduce - // access so for now, assume that the presence of any path in the event list means they - // might have some access to those events. - // - if (!hasValidAttributePath && requestedEventPathCount == 0) + if (!hasValidAttributePath && !hasValidEventPath) { ChipLogError(InteractionModel, "Subscription from [%u:" ChipLogFormatX64 "] has no access at all. Rejecting request.", diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index 5401511899e0d5..b7de62e16ff0be 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -398,6 +399,19 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, AttributePathIBs::Parser & aAttributePathListParser, bool & aHasValidAttributePath, size_t & aRequestedAttributePathCount); + /** + * This parses the event path list to ensure it is well formed. If so, for each path in the list, it will expand to a list + * of concrete paths and walk each path to check if it has privileges to read that event. + * + * If there is AT LEAST one "existent path" (as the spec calls it) that has sufficient privilege, aHasValidEventPath + * will be set to true. Otherwise, it will be set to false. + * + * aRequestedEventPathCount will be updated to reflect the number of event paths in the request. + */ + static CHIP_ERROR ParseEventPaths(const Access::SubjectDescriptor & aSubjectDescriptor, + EventPathIBs::Parser & aEventPathListParser, bool & aHasValidEventPath, + size_t & aRequestedEventPathCount); + /** * Called when Interaction Model receives a Read Request message. Errors processing * the Read Request are handled entirely within this function. If the @@ -677,7 +691,12 @@ bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint); * * @retval The metadata of the attribute, will return null if the given attribute does not exists. */ -const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath); +const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aPath); + +/** + * Returns the event support status for the given event, as an interaction model status. + */ +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath); } // namespace app } // namespace chip diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 7761e24ffb1c75..0f9d592737ce79 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -295,6 +295,8 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu CHIP_ERROR Engine::CheckAccessDeniedEventPaths(TLV::TLVWriter & aWriter, bool & aHasEncodedData, ReadHandler * apReadHandler) { + using Protocols::InteractionModel::Status; + CHIP_ERROR err = CHIP_NO_ERROR; for (auto current = apReadHandler->mpEventPathList; current != nullptr;) { @@ -304,8 +306,21 @@ CHIP_ERROR Engine::CheckAccessDeniedEventPaths(TLV::TLVWriter & aWriter, bool & continue; } - Access::RequestPath requestPath{ .cluster = current->mValue.mClusterId, .endpoint = current->mValue.mEndpointId }; ConcreteEventPath path(current->mValue.mEndpointId, current->mValue.mClusterId, current->mValue.mEventId); + Status status = CheckEventSupportStatus(path); + if (status != Status::Success) + { + TLV::TLVWriter checkpoint = aWriter; + err = EventReportIB::ConstructEventStatusIB(aWriter, path, StatusIB(status)); + if (err != CHIP_NO_ERROR) + { + aWriter = checkpoint; + break; + } + aHasEncodedData = true; + } + + Access::RequestPath requestPath{ .cluster = current->mValue.mClusterId, .endpoint = current->mValue.mEndpointId }; Access::Privilege requestPrivilege = RequiredPrivilege::ForReadEvent(path); err = Access::GetAccessControl().Check(apReadHandler->GetSubjectDescriptor(), requestPath, requestPrivilege); @@ -316,8 +331,7 @@ CHIP_ERROR Engine::CheckAccessDeniedEventPaths(TLV::TLVWriter & aWriter, bool & else { TLV::TLVWriter checkpoint = aWriter; - err = EventReportIB::ConstructEventStatusIB(aWriter, path, - StatusIB(Protocols::InteractionModel::Status::UnsupportedAccess)); + err = EventReportIB::ConstructEventStatusIB(aWriter, path, StatusIB(Status::UnsupportedAccess)); if (err != CHIP_NO_ERROR) { aWriter = checkpoint; diff --git a/src/app/tests/TestAclAttribute.cpp b/src/app/tests/TestAclAttribute.cpp index 8d17a94cccff81..cd7d774ef3429a 100644 --- a/src/app/tests/TestAclAttribute.cpp +++ b/src/app/tests/TestAclAttribute.cpp @@ -19,6 +19,8 @@ #include "lib/support/CHIPMem.h" #include #include +#include +#include #include #include #include @@ -140,6 +142,16 @@ bool ConcreteAttributePathExists(const ConcreteAttributePath & aPath) return aPath.mClusterId != kTestDeniedClusterId1; } +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) +{ + if (aPath.mClusterId == kTestDeniedClusterId1) + { + return Protocols::InteractionModel::Status::UnsupportedCluster; + } + + return Protocols::InteractionModel::Status::Success; +} + class TestAclAttribute { public: diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 5a5073f1f04059..fe0d2a04e39731 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -54,10 +54,12 @@ uint8_t gInfoEventBuffer[128]; uint8_t gCritEventBuffer[128]; chip::app::CircularEventBuffer gCircularEventBuffer[3]; chip::ClusterId kTestClusterId = 6; +chip::ClusterId kTestEventClusterId = chip::Test::MockClusterId(1); chip::ClusterId kInvalidTestClusterId = 7; chip::EndpointId kTestEndpointId = 1; -chip::EventId kTestEventIdDebug = 1; -chip::EventId kTestEventIdCritical = 2; +chip::EndpointId kTestEventEndpointId = chip::Test::kMockEndpoint1; +chip::EventId kTestEventIdDebug = chip::Test::MockEventId(1); +chip::EventId kTestEventIdCritical = chip::Test::MockEventId(2); uint8_t kTestFieldValue1 = 1; chip::TLV::Tag kTestEventTag = chip::TLV::ContextTag(1); chip::EndpointId kInvalidTestEndpointId = 3; @@ -128,11 +130,11 @@ void GenerateEvents(nlTestSuite * apSuite, void * apContext) CHIP_ERROR err = CHIP_NO_ERROR; chip::EventNumber eid1, eid2; chip::app::EventOptions options1; - options1.mPath = { kTestEndpointId, kTestClusterId, kTestEventIdDebug }; + options1.mPath = { kTestEventEndpointId, kTestEventClusterId, kTestEventIdDebug }; options1.mPriority = chip::app::PriorityLevel::Info; chip::app::EventOptions options2; - options2.mPath = { kTestEndpointId, kTestClusterId, kTestEventIdCritical }; + options2.mPath = { kTestEventEndpointId, kTestEventClusterId, kTestEventIdCritical }; options2.mPriority = chip::app::PriorityLevel::Critical; TestEventGenerator testEventGenerator; chip::app::EventManagement & logMgmt = chip::app::EventManagement::GetInstance(); @@ -820,8 +822,8 @@ void TestReadInteraction::TestReadRoundtrip(nlTestSuite * apSuite, void * apCont NL_TEST_ASSERT(apSuite, !delegate.mGotEventResponse); chip::app::EventPathParams eventPathParams[1]; - eventPathParams[0].mEndpointId = kTestEndpointId; - eventPathParams[0].mClusterId = kTestClusterId; + eventPathParams[0].mEndpointId = kTestEventEndpointId; + eventPathParams[0].mClusterId = kTestEventClusterId; chip::app::AttributePathParams attributePathParams[2]; attributePathParams[0].mEndpointId = kTestEndpointId; @@ -1498,12 +1500,12 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -1690,11 +1692,11 @@ void TestReadInteraction::TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -2340,12 +2342,12 @@ void TestReadInteraction::TestPostSubscribeRoundtripStatusReportTimeout(nlTestSu ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -2461,12 +2463,12 @@ void TestReadInteraction::TestSubscribeRoundtripStatusReportTimeout(nlTestSuite ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -2641,12 +2643,12 @@ void TestReadInteraction::TestSubscribeRoundtripChunkStatusReportTimeout(nlTestS ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -2712,12 +2714,12 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkStatusReportTimeout(nlT ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -2814,12 +2816,12 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkReportTimeout(nlTestSui ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; @@ -2915,12 +2917,12 @@ void TestReadInteraction::TestPostSubscribeRoundtripChunkReport(nlTestSuite * ap ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); chip::app::EventPathParams eventPathParams[2]; readPrepareParams.mpEventPathParamsList = eventPathParams; - readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[0].mEventId = kTestEventIdDebug; - readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEndpointId; - readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestClusterId; + readPrepareParams.mpEventPathParamsList[1].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[1].mClusterId = kTestEventClusterId; readPrepareParams.mpEventPathParamsList[1].mEventId = kTestEventIdCritical; readPrepareParams.mEventPathParamsListSize = 2; diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index f9160e2326bc75..24ed65a26869f9 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -659,6 +660,11 @@ bool ConcreteAttributePathExists(const ConcreteAttributePath & aPath) return true; } +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) +{ + return Protocols::InteractionModel::Status::Success; +} + CHIP_ERROR WriteSingleClusterData(const Access::SubjectDescriptor & aSubjectDescriptor, const ConcreteDataAttributePath & aPath, TLV::TLVReader & aReader, WriteHandler *) { diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index 96f49f8d1b6898..f7b003754da86a 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include @@ -128,6 +130,11 @@ bool ConcreteAttributePathExists(const ConcreteAttributePath & aPath) return true; } +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) +{ + return Protocols::InteractionModel::Status::Success; +} + const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath) { // Note: This test does not make use of the real attribute metadata. diff --git a/src/app/tests/suites/TestEvents.yaml b/src/app/tests/suites/TestEvents.yaml index 03f314fea3bdbe..637268ecdc587d 100644 --- a/src/app/tests/suites/TestEvents.yaml +++ b/src/app/tests/suites/TestEvents.yaml @@ -37,7 +37,8 @@ tests: command: "readEvent" event: "TestEvent" endpoint: 0 - response: [] + response: + error: UNSUPPORTED_CLUSTER - label: "Generate an event on the accessory" command: "TestEmitTestEventRequest" diff --git a/src/app/util/af.h b/src/app/util/af.h index 971f6b89dfe45b..b8c397f48c3270 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -35,6 +35,8 @@ #include +#include + #include #include #include @@ -127,11 +129,6 @@ EmberAfStatus emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cl extern EmberAfDefinedEndpoint emAfEndpoints[]; #endif -/** - * @brief Macro that takes index of endpoint, and returns Zigbee endpoint - */ -chip::EndpointId emberAfEndpointFromIndex(uint16_t index); - /** * @brief Returns root endpoint of a composed bridged device */ @@ -191,11 +188,6 @@ uint16_t emberAfIndexFromEndpointIncludingDisabledEndpoints(chip::EndpointId end uint16_t emberAfGetClusterServerEndpointIndex(chip::EndpointId endpoint, chip::ClusterId cluster, uint16_t fixedClusterServerEndpointCount); -/** - * @brief Returns the total number of endpoints (dynamic and pre-compiled). - */ -uint16_t emberAfEndpointCount(void); - /** * @brief Returns the number of pre-compiled endpoints. */ @@ -244,11 +236,6 @@ bool emberAfIsDeviceIdentifying(chip::EndpointId endpoint); */ bool emberAfEndpointEnableDisable(chip::EndpointId endpoint, bool enable); -/** - * @brief Determine if an endpoint at the specified index is enabled or disabled - */ -bool emberAfEndpointIndexIsEnabled(uint16_t index); - /** @brief Returns true if a given ZCL data type is a list type. */ bool emberAfIsThisDataTypeAListType(EmberAfAttributeType dataType); diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index d8617e1837dfd1..da83bf1840e27d 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -100,10 +101,6 @@ bool emAfMatchCluster(const EmberAfCluster * cluster, EmberAfAttributeSearchReco bool emAfMatchAttribute(const EmberAfCluster * cluster, const EmberAfAttributeMetadata * am, EmberAfAttributeSearchRecord * attRecord); -// Returns endpoint type for the given endpoint id if there is an enabled -// endpoint with that endpoint id. Otherwise returns null. -const EmberAfEndpointType * emberAfFindEndpointType(chip::EndpointId endpointId); - // Check if a cluster is implemented or not. If yes, the cluster is returned. // // mask = 0 -> find either client or server @@ -148,9 +145,6 @@ chip::Optional emberAfGetNthClusterId(chip::EndpointId endpoint // for the given endpoint and client/server polarity uint8_t emberAfGetClustersFromEndpoint(chip::EndpointId endpoint, chip::ClusterId * clusterList, uint8_t listLen, bool server); -// Returns server cluster within the endpoint, or NULL if it isn't there -const EmberAfCluster * emberAfFindServerCluster(chip::EndpointId endpoint, chip::ClusterId clusterId); - // Returns cluster within the endpoint; Does not ignore disabled endpoints const EmberAfCluster * emberAfFindClusterIncludingDisabledEndpoints(chip::EndpointId endpoint, chip::ClusterId clusterId, EmberAfClusterMask mask); diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index c28eb8152a1f75..de08342c4f18f6 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -957,10 +958,9 @@ CHIP_ERROR prepareWriteData(const EmberAfAttributeMetadata * attributeMetadata, } } // namespace -const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath) +const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aPath) { - return emberAfLocateAttributeMetadata(aConcreteClusterPath.mEndpointId, aConcreteClusterPath.mClusterId, - aConcreteClusterPath.mAttributeId); + return emberAfLocateAttributeMetadata(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId); } CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, const ConcreteDataAttributePath & aPath, @@ -1071,6 +1071,38 @@ bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) return false; } +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) +{ + using Protocols::InteractionModel::Status; + + const EmberAfEndpointType * type = emberAfFindEndpointType(aPath.mEndpointId); + if (type == nullptr) + { + return Status::UnsupportedEndpoint; + } + + const EmberAfCluster * cluster = emberAfFindClusterInType(type, aPath.mClusterId, CLUSTER_MASK_SERVER); + if (cluster == nullptr) + { + return Status::UnsupportedCluster; + } + +#if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE + for (size_t i = 0; i < cluster->eventCount; ++i) + { + if (cluster->eventList[i] == aPath.mEventId) + { + return Status::Success; + } + } + + return Status::UnsupportedEvent; +#else + // No way to tell. Just claim supported. + return Status::Success; +#endif // CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE +} + } // namespace app } // namespace chip diff --git a/src/app/util/endpoint-config-api.h b/src/app/util/endpoint-config-api.h new file mode 100644 index 00000000000000..3358d8453c6c9f --- /dev/null +++ b/src/app/util/endpoint-config-api.h @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/** + * Declarations of function that can be used to query the endpoint configuration + * for the device. + */ + +#include + +/** + * Returns the total number of possible endpoints (dynamic and pre-compiled). + * Not all those endpoints might be enabled, and the dynamic ones might not even + * have an EmberAfEndpointType defined. + * + * Typically only used for endpoint index iteration. + */ +uint16_t emberAfEndpointCount(void); + +/** + * Returns whether the endpoint at the specified index (which must be less than + * emberAfEndpointCount() is enabled. If an endpoint is disabled, it is not + * guaranteed to have an EmberAfEndpointType. + */ +bool emberAfEndpointIndexIsEnabled(uint16_t index); + +/** + * Returns the endpoint id of the endpoint at the given index. Will return + * kInvalidEndpointId for endpoints that are not actually configured. + */ +chip::EndpointId emberAfEndpointFromIndex(uint16_t index); + +/** + * Returns the endpoint descriptor for the given endpoint id if there is an + * enabled endpoint with that endpoint id. Otherwise returns null. + */ +const EmberAfEndpointType * emberAfFindEndpointType(chip::EndpointId endpointId); + +/** + * Returns the cluster descriptor for the given cluster on the given endpoint. + * + * If the given endpoint does not exist or is disabled, returns null. + * + * If the given endpoint does not have the given cluster, returns null. + */ +const EmberAfCluster * emberAfFindServerCluster(chip::EndpointId endpoint, chip::ClusterId clusterId); + +/** + * Returns true if the given endpoint exists, is enabled, has the given cluster, + * and that cluster has the given attribute. + */ +bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId); diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index 208ddec7b523e4..98a905615d9a4e 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -48,6 +48,7 @@ #include #include +#include #include typedef uint8_t EmberAfClusterMask; @@ -65,6 +66,8 @@ ClusterId clusters[] = { MockClusterId(1), MockClusterId(2), MockClusterId( MockClusterId(1), MockClusterId(2), MockClusterId(3), MockClusterId(4) }; uint16_t attributeIndex[] = { 0, 2, 5, 7, 11, 16, 19, 25, 27 }; uint16_t attributeCount[] = { 2, 3, 2, 4, 5, 3, 6, 2, 2 }; +uint16_t eventIndex[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2 }; +uint16_t eventCount[] = { 2, 0, 0, 0, 0, 0, 0, 0, 0 }; AttributeId attributes[] = { // clang-format off Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id, @@ -78,6 +81,10 @@ AttributeId attributes[] = { Clusters::Globals::Attributes::ClusterRevision::Id, Clusters::Globals::Attributes::FeatureMap::Id // clang-format on }; +EventId events[] = { + MockEventId(1), + MockEventId(2), +}; uint16_t mockClusterRevision = 1; uint32_t mockFeatureMap = 0x1234; @@ -95,6 +102,32 @@ uint8_t mockAttribute4[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, }; +#define MOCK_CLUSTER_DECL(idx) \ + { \ + .clusterId = clusters[idx], .attributes = nullptr, /* Not used for now. */ \ + .attributeCount = attributeCount[idx], .clusterSize = 0, /* Not used for now. */ \ + .mask = CLUSTER_MASK_SERVER, .functions = nullptr, .acceptedCommandList = nullptr, /* Not used for now */ \ + .generatedCommandList = nullptr, /* Not used for now */ \ + .eventList = &events[eventIndex[idx]], .eventCount = eventCount[idx], \ + } + +EmberAfCluster clusterStructs[] = { + MOCK_CLUSTER_DECL(0), MOCK_CLUSTER_DECL(1), MOCK_CLUSTER_DECL(2), MOCK_CLUSTER_DECL(3), MOCK_CLUSTER_DECL(4), + MOCK_CLUSTER_DECL(5), MOCK_CLUSTER_DECL(6), MOCK_CLUSTER_DECL(7), MOCK_CLUSTER_DECL(8), +}; + +#define MOCK_ENDPOINT_DECL(idx) \ + { \ + .cluster = &clusterStructs[clusterIndex[idx]], .clusterCount = clusterCount[idx], \ + .endpointSize = 0, /* Not used for now */ \ + } + +EmberAfEndpointType endpointStructs[] = { + MOCK_ENDPOINT_DECL(0), + MOCK_ENDPOINT_DECL(1), + MOCK_ENDPOINT_DECL(2), +}; + } // namespace uint16_t emberAfEndpointCount() @@ -284,7 +317,37 @@ bool emberAfContainsServerFromIndex(uint16_t index, ClusterId clusterId) return false; } - return clusterId; // Mock version return true as long as the endpoint is valid + return clusterId; // Mock version return true as long as the endpoint is + // valid +} + +const EmberAfEndpointType * emberAfFindEndpointType(EndpointId endpointId) +{ + uint16_t ep = emberAfIndexFromEndpoint(endpointId); + if (ep == UINT16_MAX) + { + return nullptr; + } + return &endpointStructs[ep]; +} + +const EmberAfCluster * emberAfFindServerCluster(EndpointId endpoint, ClusterId clusterId) +{ + auto * endpointType = emberAfFindEndpointType(endpoint); + if (endpointType == nullptr) + { + return nullptr; + } + + for (decltype(endpointType->clusterCount) idx = 0; idx < endpointType->clusterCount; ++idx) + { + auto * cluster = &endpointType->cluster[idx]; + if (cluster->clusterId == clusterId && (cluster->mask & CLUSTER_MASK_SERVER)) + { + return cluster; + } + } + return nullptr; } namespace chip { diff --git a/src/app/util/util.h b/src/app/util/util.h index 120c6b07c671da..ab13ba1768d085 100644 --- a/src/app/util/util.h +++ b/src/app/util/util.h @@ -20,6 +20,7 @@ #include #include +#include // Cluster name structure typedef struct @@ -42,8 +43,6 @@ uint16_t emberAfFindClusterNameIndex(chip::ClusterId cluster); */ EmberAfDifferenceType emberAfGetDifference(uint8_t * pData, EmberAfDifferenceType value, uint8_t dataSize); -bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId); - /* @brief returns true if the attribute is known to be volatile (i.e. RAM * storage). */ diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index b72c1fd8a0d6df..6e185c00dcf9ff 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -20,6 +20,8 @@ #include "transport/SecureSession.h" #include #include +#include +#include #include #include #include @@ -239,6 +241,11 @@ bool ConcreteAttributePathExists(const ConcreteAttributePath & aPath) return true; } +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) +{ + return Protocols::InteractionModel::Status::Success; +} + } // namespace app } // namespace chip diff --git a/src/darwin/Framework/CHIP/MTRIMDispatch.mm b/src/darwin/Framework/CHIP/MTRIMDispatch.mm index e1dfd9d426344d..3b9c62c9e503d4 100644 --- a/src/darwin/Framework/CHIP/MTRIMDispatch.mm +++ b/src/darwin/Framework/CHIP/MTRIMDispatch.mm @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -223,6 +224,11 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aPath, TLV::TLVRea } } + Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) + { + return Protocols::InteractionModel::Status::UnsupportedEvent; + } + } // namespace app } // namespace chip @@ -305,3 +311,42 @@ uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClu } bool emberAfEndpointIndexIsEnabled(uint16_t index) { return index == 0; } + +namespace { +const CommandId acceptedCommands[] = { Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Id, + Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, + Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, kInvalidCommandId }; +const CommandId generatedCommands[] = { Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id, + Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id, kInvalidCommandId }; +const EmberAfCluster otaProviderCluster { + .clusterId = Clusters::OtaSoftwareUpdateProvider::Id, + .attributes = nullptr, + .attributeCount = 0, + .clusterSize = 0, + .mask = CLUSTER_MASK_SERVER, + .functions = nullptr, + .acceptedCommandList = acceptedCommands, + .generatedCommandList = generatedCommands, + .eventList = nullptr, + .eventCount = 0, +}; +const EmberAfEndpointType otaProviderEndpoint { .cluster = &otaProviderCluster, .clusterCount = 1, .endpointSize = 0 }; +} + +const EmberAfEndpointType * emberAfFindEndpointType(EndpointId endpoint) +{ + if (endpoint == kSupportedEndpoint) { + return &otaProviderEndpoint; + } + + return nullptr; +} + +const EmberAfCluster * emberAfFindServerCluster(EndpointId endpoint, ClusterId cluster) +{ + if (endpoint == kSupportedEndpoint && cluster == Clusters::OtaSoftwareUpdateProvider::Id) { + return &otaProviderCluster; + } + + return nullptr; +} diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index eb334429336849..a4e0577f8f92ef 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -2053,9 +2053,7 @@ - (void)test023_SubscribeMultipleAttributes XCTestExpectation * onOffReportExpectation = [self expectationWithDescription:@"report OnOff attribute"]; XCTestExpectation * attributeErrorReportExpectation = [self expectationWithDescription:@"report nonexistent attribute"]; - // TODO: Right now the server does not seem to actually produce an error - // when trying to subscribe to events on a non-existent endpoint. - // XCTestExpectation * eventErrorReportExpectation = [self expectationWithDescription:@"report nonexistent event"]; + XCTestExpectation * eventErrorReportExpectation = [self expectationWithDescription:@"report nonexistent event"]; globalReportHandler = ^(id _Nullable values, NSError * _Nullable error) { XCTAssertNil(error); XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:error], 0); @@ -2085,18 +2083,14 @@ - (void)test023_SubscribeMultipleAttributes } } else if (result[@"eventPath"] != nil) { MTREventPath * path = result[@"eventPath"]; - XCTAssertEqualObjects(path.endpoint, @1); - XCTAssertEqualObjects(path.cluster, failClusterId); + XCTAssertEqualObjects(path.endpoint, failEndpointId); + XCTAssertEqualObjects(path.cluster, @40); XCTAssertEqualObjects(path.event, @0); XCTAssertNil(result[@"data"]); XCTAssertNotNil(result[@"error"]); XCTAssertEqual( [MTRErrorTestUtils errorToZCLErrorCode:result[@"error"]], MTRInteractionErrorCodeUnsupportedEndpoint); - // TODO: Right now the server does not seem to actually produce an error - // when trying to subscribe to events on a non-existent - // endpoint. Catch it if it starts doing that. - XCTFail("Need to re-enable the eventErrorReportExpectation bits"); - // [eventErrorReportExpectation fulfill]; + [eventErrorReportExpectation fulfill]; } else { XCTFail("Unexpected result dictionary"); } @@ -2122,9 +2116,7 @@ - (void)test023_SubscribeMultipleAttributes resubscriptionScheduled:nil]; // Wait till establishment - [self waitForExpectations:@[ - onOffReportExpectation, attributeErrorReportExpectation, /* eventErrorReportExpectation, */ expectation - ] + [self waitForExpectations:@[ onOffReportExpectation, attributeErrorReportExpectation, eventErrorReportExpectation, expectation ] timeout:kTimeoutInSeconds]; // Set up expectation for report @@ -2133,19 +2125,28 @@ - (void)test023_SubscribeMultipleAttributes XCTAssertNil(error); XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:error], 0); XCTAssertTrue([values isKindOfClass:[NSArray class]]); - NSDictionary * result = values[0]; - MTRAttributePath * path = result[@"attributePath"]; - // We will only be getting incremental reports for the OnOff attribute. - XCTAssertEqualObjects(path.endpoint, @1); - XCTAssertEqualObjects(path.cluster, @6); - XCTAssertEqualObjects(path.attribute, @0); + for (NSDictionary * result in values) { + // Note: we will get updates for our event subscription too, each time + // with errors. + if (result[@"eventPath"] != nil) { + continue; + } - XCTAssertTrue([result[@"data"] isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"data"][@"type"] isEqualToString:@"Boolean"]); - if ([result[@"data"][@"value"] boolValue] == YES) { - [reportExpectation fulfill]; - globalReportHandler = nil; + MTRAttributePath * path = result[@"attributePath"]; + XCTAssertNotNil(path); + + // We will only be getting incremental attribute reports for the OnOff attribute. + XCTAssertEqualObjects(path.endpoint, @1); + XCTAssertEqualObjects(path.cluster, @6); + XCTAssertEqualObjects(path.attribute, @0); + + XCTAssertTrue([result[@"data"] isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"data"][@"type"] isEqualToString:@"Boolean"]); + if ([result[@"data"][@"value"] boolValue] == YES) { + [reportExpectation fulfill]; + globalReportHandler = nil; + } } }; @@ -2190,16 +2191,26 @@ - (void)test023_SubscribeMultipleAttributes XCTAssertNil(error); XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:error], 0); XCTAssertTrue([values isKindOfClass:[NSArray class]]); - NSDictionary * result = values[0]; - MTRAttributePath * path = result[@"attributePath"]; - XCTAssertEqualObjects(path.endpoint, @1); - XCTAssertEqualObjects(path.cluster, @6); - XCTAssertEqualObjects(path.attribute, @0); - XCTAssertTrue([result[@"data"] isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"data"][@"type"] isEqualToString:@"Boolean"]); - if ([result[@"data"][@"value"] boolValue] == NO) { - [reportExpectation fulfill]; - globalReportHandler = nil; + + for (NSDictionary * result in values) { + // Note: we will get updates for our event subscription too, each time + // with errors. + if (result[@"eventPath"] != nil) { + continue; + } + + MTRAttributePath * path = result[@"attributePath"]; + XCTAssertNotNil(path); + + XCTAssertEqualObjects(path.endpoint, @1); + XCTAssertEqualObjects(path.cluster, @6); + XCTAssertEqualObjects(path.attribute, @0); + XCTAssertTrue([result[@"data"] isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"data"][@"type"] isEqualToString:@"Boolean"]); + if ([result[@"data"][@"value"] boolValue] == NO) { + [reportExpectation fulfill]; + globalReportHandler = nil; + } } }; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index dbf8227542040d..ac13daf482c5f8 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -73275,6 +73275,10 @@ class TestEventsSuite : public TestCommand case 2: switch (mTestSubStepIndex) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_CLUSTER)); + mTestSubStepIndex++; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); break; @@ -73460,7 +73464,7 @@ class TestEventsSuite : public TestCommand } case 2: { LogStep(2, "Check reading events from an invalid endpoint"); - mTestSubStepCount = 0; + mTestSubStepCount = 1; return ReadEvent(kIdentityAlpha, GetEndpoint(0), UnitTesting::Id, UnitTesting::Events::TestEvent::Id, false, chip::NullOptional); } From 4e9d26e7c0a1d5da5b642d8f4fc21e7937ea8337 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:26:36 -0400 Subject: [PATCH 02/31] enable peristent subs by default (#27222) --- examples/platform/silabs/efr32/BUILD.gn | 3 --- src/platform/device.gni | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/platform/silabs/efr32/BUILD.gn b/examples/platform/silabs/efr32/BUILD.gn index 34f4f503008618..5a7e50056e8a86 100644 --- a/examples/platform/silabs/efr32/BUILD.gn +++ b/examples/platform/silabs/efr32/BUILD.gn @@ -43,9 +43,6 @@ declare_args() { chip_config_use_icd_subscription_callbacks = enable_sleepy_device } -# Use persitent subscriptions for IC devices -chip_persist_subscriptions = enable_sleepy_device - silabs_common_plat_dir = "${chip_root}/examples/platform/silabs" import("${silabs_common_plat_dir}/args.gni") diff --git a/src/platform/device.gni b/src/platform/device.gni index 43bf65ab03b72f..b22e30930978e3 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -103,7 +103,8 @@ declare_args() { # Enable Subscription persistence / resumption for CI and supported platforms if (chip_device_platform == "darwin" || chip_device_platform == "linux" || - chip_device_platform == "esp32" || chip_device_platform == "fake") { + chip_device_platform == "esp32" || chip_device_platform == "fake" || + chip_device_platform == "efr32" || chip_device_platform == "SiWx917") { chip_persist_subscriptions = true } else { chip_persist_subscriptions = false From 3458a33a06e62b9a6162f7445c57aa0712bc65ad Mon Sep 17 00:00:00 2001 From: PSONALl <77670766+PSONALl@users.noreply.github.com> Date: Thu, 15 Jun 2023 01:59:47 +0530 Subject: [PATCH 03/31] fix compilation error for esp32 ble controller (#27231) --- src/platform/ESP32/BLEManagerImpl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/ESP32/BLEManagerImpl.h b/src/platform/ESP32/BLEManagerImpl.h index d47010e84d5afd..e7f61785ffa5c8 100644 --- a/src/platform/ESP32/BLEManagerImpl.h +++ b/src/platform/ESP32/BLEManagerImpl.h @@ -24,6 +24,7 @@ */ #pragma once +#include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE From 69ffbed52e6eff67e2a6caec6b3807de27bfb039 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 14 Jun 2023 18:43:16 -0400 Subject: [PATCH 04/31] Reduce number of replies on MinMds query processing. (#27183) * Reduce number of replies on MinMds query processing. UDP packets are received on every listening interface, resulting in single queries being multipled by the interface count and this causes more packets than expected being generated. This change will only process queries that are originating from the same interface that the mdns endpoint is bound to. * Restyled by clang-format --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- src/lib/dnssd/minimal_mdns/Server.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/dnssd/minimal_mdns/Server.cpp b/src/lib/dnssd/minimal_mdns/Server.cpp index 7fd02f4968aae9..ccf041eb605d7c 100644 --- a/src/lib/dnssd/minimal_mdns/Server.cpp +++ b/src/lib/dnssd/minimal_mdns/Server.cpp @@ -467,7 +467,13 @@ void ServerBase::OnUdpPacketReceived(chip::Inet::UDPEndPoint * endPoint, chip::S if (HeaderRef(const_cast(data.Start())).GetFlags().IsQuery()) { - srv->mDelegate->OnQuery(data, info); + // Only consider queries that are received on the same interface we are listening on. + // Without this, queries show up on all addresses on all interfaces, resulting + // in more replies than one would expect. + if (endPoint->GetBoundInterface() == info->Interface) + { + srv->mDelegate->OnQuery(data, info); + } } else { From 6717172ad451cb2061283516fc207f9bf9b4afcd Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Wed, 14 Jun 2023 22:38:14 -0400 Subject: [PATCH 05/31] Fix PAA pathlen check to match spec (#27207) * Fix PAA pathlen check Problem: - Since Matter 1.1, PAAs are allowed to omit the pathlen optional field to basic constraints extension. The code did not do that - Fixes #27194 Changes in this PR: - Update all CryptoPAL backends to fix the path length checks - Added unit tests covering valid and invalid basic constraints around path lengths. Testing done: - Unit tests pass on both mbedTLS and BoringSSL/OpenSSL CryptoPAL * Restyled by clang-format * Address review comments * Address review comments * Improve logic with help from @bzbarsky-apple * Restyled by clang-format --------- Co-authored-by: tennessee.carmelveilleux@gmail.com Co-authored-by: Restyled.io --- src/crypto/CHIPCryptoPALOpenSSL.cpp | 3 +- src/crypto/CHIPCryptoPALPSA.cpp | 18 +- src/crypto/CHIPCryptoPALmbedTLS.cpp | 18 +- src/crypto/tests/BUILD.gn | 1 + src/crypto/tests/CHIPCryptoPALTest.cpp | 13 ++ .../tests/DacValidationExplicitVectors.h | 180 ++++++++++++++++++ .../common/crypto/CHIPCryptoPALTinyCrypt.cpp | 18 +- .../crypto/CHIPCryptoPALNXPUltrafastP256.cpp | 18 +- .../silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp | 18 +- .../silabs/efr32/CHIPCryptoPALPsaEfr32.cpp | 18 +- 10 files changed, 268 insertions(+), 37 deletions(-) create mode 100644 src/crypto/tests/DacValidationExplicitVectors.h diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index a3321aaf9e2828..e181190a109bb6 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -1653,7 +1653,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), err = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), err = CHIP_ERROR_INTERNAL); } } break; diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index 2d01e3229b4918..e8d4b75c9221b1 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -1295,9 +1295,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; + int isCA = 0; + int pathLen = -1; VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); extBasicPresent = true; @@ -1306,11 +1305,17 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); if (len > 0) { - result = mbedtls_asn1_get_bool(&p, end, &isCA); + unsigned char * seqStart = p; + result = mbedtls_asn1_get_bool(&p, end, &isCA); VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - if (p != seqStart + len) + // Check if pathLen is there by validating if the cursor didn't get to the end of + // of the internal SEQUENCE for the basic constraints encapsulation. + // Missing pathLen optional tag will leave pathLen == -1 for following checks. + bool hasPathLen = (p != (seqStart + len)); + if (hasPathLen) { + // Extract pathLen value, making sure it's a valid format. result = mbedtls_asn1_get_int(&p, end, &pathLen); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); } @@ -1326,7 +1331,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), error = CHIP_ERROR_INTERNAL); } } else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index 26a00156725791..92ec3048fe8de6 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -1386,9 +1386,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; + int isCA = 0; + int pathLen = -1; VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); extBasicPresent = true; @@ -1397,11 +1396,17 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); if (len > 0) { - result = mbedtls_asn1_get_bool(&p, end, &isCA); + unsigned char * seqStart = p; + result = mbedtls_asn1_get_bool(&p, end, &isCA); VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - if (p != seqStart + len) + // Check if pathLen is there by validating if the cursor didn't get to the end of + // of the internal SEQUENCE for the basic constraints encapsulation. + // Missing pathLen optional tag will leave pathLen == -1 for following checks. + bool hasPathLen = (p != (seqStart + len)); + if (hasPathLen) { + // Extract pathLen value, making sure it's a valid format. result = mbedtls_asn1_get_int(&p, end, &pathLen); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); } @@ -1417,7 +1422,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), error = CHIP_ERROR_INTERNAL); } } else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) diff --git a/src/crypto/tests/BUILD.gn b/src/crypto/tests/BUILD.gn index ea3ee0dc124f5d..0f2fde50996481 100644 --- a/src/crypto/tests/BUILD.gn +++ b/src/crypto/tests/BUILD.gn @@ -25,6 +25,7 @@ chip_test_suite("tests") { sources = [ "AES_CCM_128_test_vectors.h", "CHIPCryptoPALTest.cpp", + "DacValidationExplicitVectors.h", "DerSigConversion_test_vectors.h", "ECDH_P256_test_vectors.h", "HKDF_SHA256_test_vectors.h", diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index fae25912c2fe44..3ceda243d2347d 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -156,6 +156,8 @@ class HeapChecker }; #endif +#include "DacValidationExplicitVectors.h" + } // namespace static uint32_t gs_test_entropy_source_called = 0; @@ -1956,14 +1958,25 @@ static void TestX509_VerifyAttestationCertificateFormat(nlTestSuite * inSuite, v { ByteSpan(), Crypto::AttestationCertType::kDAC, CHIP_ERROR_INVALID_ARGUMENT }, { sTestCert_PAI_FFF2_NoPID_FB_Cert, Crypto::AttestationCertType::kDAC, CHIP_ERROR_INTERNAL }, { sTestCert_DAC_FFF2_8006_0025_ValInFuture_Cert, Crypto::AttestationCertType::kPAA, CHIP_ERROR_INTERNAL }, + { ByteSpan{kPaaWithNoPathlen}, Crypto::AttestationCertType::kPAA, CHIP_NO_ERROR }, + { ByteSpan{kPaiPathLenMissing}, Crypto::AttestationCertType::kPAI, CHIP_ERROR_INTERNAL }, + { ByteSpan{kPaiPathLen1}, Crypto::AttestationCertType::kPAI, CHIP_ERROR_INTERNAL }, + { ByteSpan{kPaaPathLen2}, Crypto::AttestationCertType::kPAA, CHIP_ERROR_INTERNAL }, }; // clang-format on + int case_idx = 0; for (auto & testCase : sValidationTestCases) { ByteSpan cert = testCase.cert; CHIP_ERROR err = VerifyAttestationCertificateFormat(cert, testCase.type); + if (err != testCase.expectedError) + { + ChipLogError(Crypto, "Failed TestX509_VerifyAttestationCertificateFormat sub-case %d, err: %" CHIP_ERROR_FORMAT, + case_idx, err.Format()); + } NL_TEST_ASSERT(inSuite, err == testCase.expectedError); + ++case_idx; } } diff --git a/src/crypto/tests/DacValidationExplicitVectors.h b/src/crypto/tests/DacValidationExplicitVectors.h new file mode 100644 index 00000000000000..ea1dc6d0584520 --- /dev/null +++ b/src/crypto/tests/DacValidationExplicitVectors.h @@ -0,0 +1,180 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// This file contains test certificate bodies with particular situations that +// were not auto-generated, but rather constructed. + +#pragma once + +#include + +/* +-----BEGIN CERTIFICATE----- +MIIByjCCAXCgAwIBAgIRALmDRJO1vv31wcqYjJYpxZQwCgYIKoZIzj0EAwIwMzEb +MBkGA1UEAwwSUWlhbnlhbiBNYXR0ZXIgUEFBMRQwEgYKKwYBBAGConwCAQwEMTM4 +NzAgFw0yMzAzMTQwODIyNDRaGA85OTk5MTIzMTIzNTk1OVowMzEbMBkGA1UEAwwS +UWlhbnlhbiBNYXR0ZXIgUEFBMRQwEgYKKwYBBAGConwCAQwEMTM4NzBZMBMGByqG +SM49AgEGCCqGSM49AwEHA0IABAV999uorscml0N9OlulWuvb+6d06vsjmpwKPQd5 +mpaayy4f6ODdbycnNhHUZqxP4jQL8CLk509zlJCyTvX4f16jYzBhMA8GA1UdEwEB +/wQFMAMBAf8wHQYDVR0OBBYEFDCn/GzW+lrLgn93bjJiB2u4EeQpMA4GA1UdDwEB +/wQEAwIBhjAfBgNVHSMEGDAWgBQwp/xs1vpay4J/d24yYgdruBHkKTAKBggqhkjO +PQQDAgNIADBFAiBo6kBk1wcJjH4XYaR6cPOrCOXmbTPk20EzfoaLrXXtrgIhANmh +IEohtRvlb6URoKv1v3jwfzATeqLNY2eLKBmQjUN8 +-----END CERTIFICATE----- +*/ + +const uint8_t kPaaWithNoPathlen[462] = { + 0x30, 0x82, 0x01, 0xca, 0x30, 0x82, 0x01, 0x70, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x11, 0x00, 0xb9, 0x83, 0x44, 0x93, 0xb5, + 0xbe, 0xfd, 0xf5, 0xc1, 0xca, 0x98, 0x8c, 0x96, 0x29, 0xc5, 0x94, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, + 0x03, 0x02, 0x30, 0x33, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x12, 0x51, 0x69, 0x61, 0x6e, 0x79, 0x61, + 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x50, 0x41, 0x41, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, + 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x31, 0x33, 0x38, 0x37, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x33, 0x30, 0x33, + 0x31, 0x34, 0x30, 0x38, 0x32, 0x32, 0x34, 0x34, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, + 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x33, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x12, 0x51, 0x69, 0x61, + 0x6e, 0x79, 0x61, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x50, 0x41, 0x41, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, + 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x31, 0x33, 0x38, 0x37, 0x30, 0x59, 0x30, 0x13, 0x06, + 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, + 0x04, 0x05, 0x7d, 0xf7, 0xdb, 0xa8, 0xae, 0xc7, 0x26, 0x97, 0x43, 0x7d, 0x3a, 0x5b, 0xa5, 0x5a, 0xeb, 0xdb, 0xfb, 0xa7, 0x74, + 0xea, 0xfb, 0x23, 0x9a, 0x9c, 0x0a, 0x3d, 0x07, 0x79, 0x9a, 0x96, 0x9a, 0xcb, 0x2e, 0x1f, 0xe8, 0xe0, 0xdd, 0x6f, 0x27, 0x27, + 0x36, 0x11, 0xd4, 0x66, 0xac, 0x4f, 0xe2, 0x34, 0x0b, 0xf0, 0x22, 0xe4, 0xe7, 0x4f, 0x73, 0x94, 0x90, 0xb2, 0x4e, 0xf5, 0xf8, + 0x7f, 0x5e, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, + 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x30, 0xa7, 0xfc, 0x6c, 0xd6, 0xfa, 0x5a, 0xcb, + 0x82, 0x7f, 0x77, 0x6e, 0x32, 0x62, 0x07, 0x6b, 0xb8, 0x11, 0xe4, 0x29, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, + 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x30, + 0xa7, 0xfc, 0x6c, 0xd6, 0xfa, 0x5a, 0xcb, 0x82, 0x7f, 0x77, 0x6e, 0x32, 0x62, 0x07, 0x6b, 0xb8, 0x11, 0xe4, 0x29, 0x30, 0x0a, + 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x68, 0xea, 0x40, 0x64, + 0xd7, 0x07, 0x09, 0x8c, 0x7e, 0x17, 0x61, 0xa4, 0x7a, 0x70, 0xf3, 0xab, 0x08, 0xe5, 0xe6, 0x6d, 0x33, 0xe4, 0xdb, 0x41, 0x33, + 0x7e, 0x86, 0x8b, 0xad, 0x75, 0xed, 0xae, 0x02, 0x21, 0x00, 0xd9, 0xa1, 0x20, 0x4a, 0x21, 0xb5, 0x1b, 0xe5, 0x6f, 0xa5, 0x11, + 0xa0, 0xab, 0xf5, 0xbf, 0x78, 0xf0, 0x7f, 0x30, 0x13, 0x7a, 0xa2, 0xcd, 0x63, 0x67, 0x8b, 0x28, 0x19, 0x90, 0x8d, 0x43, 0x7c, +}; + +/* +-----BEGIN CERTIFICATE----- +MIIBuDCCAV+gAwIBAgIIEl3k+yzkQuowCgYIKoZIzj0EAwIwGjEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMB4XDTIxMDYyODE0MjM0M1oXDTMzMDYyODE0MjM0Mlow +RjEYMBYGA1UEAwwPTWF0dGVyIFRlc3QgUEFJMRQwEgYKKwYBBAGConwCAQwERkZG +MjEUMBIGCisGAQQBgqJ8AgIMBDgwMDUwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC +AAQso3JRSRbamUuVk4C2aycB9M84CPOT9xaxI4nC+VqK8vSTJiploKPr+BvganEH +MqCqoC/1KO+Vi/0gMmMvvYhfo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU2tRnb1BtRUPblHbWGGkcZ0lyjQgwHwYDVR0jBBgw +FoAUeFznBbhrj05vx5OqYMtD6mlogtUwCgYIKoZIzj0EAwIDRwAwRAIgYreXc1Ny ++5HZRSxqT4gPVP5z5ZkhZXUSYW7GHaqs8VACID/8iIGshdedcjAbI6sQO+AtevcO +qLypxnhGVlL2gQnf +-----END CERTIFICATE----- +*/ +const uint8_t kPaiPathLenMissing[444] = { + 0x30, 0x82, 0x01, 0xb8, 0x30, 0x82, 0x01, 0x5f, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x12, 0x5d, 0xe4, 0xfb, 0x2c, 0xe4, + 0x42, 0xea, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x1a, 0x31, 0x18, 0x30, 0x16, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, + 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x33, 0x33, + 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x46, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, + 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x49, 0x31, 0x14, 0x30, + 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x32, 0x31, 0x14, + 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x02, 0x0c, 0x04, 0x38, 0x30, 0x30, 0x35, 0x30, + 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, + 0x07, 0x03, 0x42, 0x00, 0x04, 0x2c, 0xa3, 0x72, 0x51, 0x49, 0x16, 0xda, 0x99, 0x4b, 0x95, 0x93, 0x80, 0xb6, 0x6b, 0x27, 0x01, + 0xf4, 0xcf, 0x38, 0x08, 0xf3, 0x93, 0xf7, 0x16, 0xb1, 0x23, 0x89, 0xc2, 0xf9, 0x5a, 0x8a, 0xf2, 0xf4, 0x93, 0x26, 0x2a, 0x65, + 0xa0, 0xa3, 0xeb, 0xf8, 0x1b, 0xe0, 0x6a, 0x71, 0x07, 0x32, 0xa0, 0xaa, 0xa0, 0x2f, 0xf5, 0x28, 0xef, 0x95, 0x8b, 0xfd, 0x20, + 0x32, 0x63, 0x2f, 0xbd, 0x88, 0x5f, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, + 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xda, 0xd4, 0x67, 0x6f, 0x50, 0x6d, 0x45, 0x43, 0xdb, + 0x94, 0x76, 0xd6, 0x18, 0x69, 0x1c, 0x67, 0x49, 0x72, 0x8d, 0x08, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, + 0x16, 0x80, 0x14, 0x78, 0x5c, 0xe7, 0x05, 0xb8, 0x6b, 0x8f, 0x4e, 0x6f, 0xc7, 0x93, 0xaa, 0x60, 0xcb, 0x43, 0xea, 0x69, 0x68, + 0x82, 0xd5, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, + 0x62, 0xb7, 0x97, 0x73, 0x53, 0x72, 0xfb, 0x91, 0xd9, 0x45, 0x2c, 0x6a, 0x4f, 0x88, 0x0f, 0x54, 0xfe, 0x73, 0xe5, 0x99, 0x21, + 0x65, 0x75, 0x12, 0x61, 0x6e, 0xc6, 0x1d, 0xaa, 0xac, 0xf1, 0x50, 0x02, 0x20, 0x3f, 0xfc, 0x88, 0x81, 0xac, 0x85, 0xd7, 0x9d, + 0x72, 0x30, 0x1b, 0x23, 0xab, 0x10, 0x3b, 0xe0, 0x2d, 0x7a, 0xf7, 0x0e, 0xa8, 0xbc, 0xa9, 0xc6, 0x78, 0x46, 0x56, 0x52, 0xf6, + 0x81, 0x09, 0xdf, +}; + +/* +-----BEGIN CERTIFICATE----- +MIIBuzCCAWKgAwIBAgIIEl3k+yzkQuowCgYIKoZIzj0EAwIwGjEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMB4XDTIxMDYyODE0MjM0M1oXDTMzMDYyODE0MjM0Mlow +RjEYMBYGA1UEAwwPTWF0dGVyIFRlc3QgUEFJMRQwEgYKKwYBBAGConwCAQwERkZG +MjEUMBIGCisGAQQBgqJ8AgIMBDgwMDUwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC +AAQso3JRSRbamUuVk4C2aycB9M84CPOT9xaxI4nC+VqK8vSTJiploKPr+BvganEH +MqCqoC/1KO+Vi/0gMmMvvYhfo2YwZDASBgNVHRMBAf8ECDAGAQH/AgEBMA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQU2tRnb1BtRUPblHbWGGkcZ0lyjQgwHwYDVR0j +BBgwFoAUeFznBbhrj05vx5OqYMtD6mlogtUwCgYIKoZIzj0EAwIDRwAwRAIgYreX +c1Ny+5HZRSxqT4gPVP5z5ZkhZXUSYW7GHaqs8VACID/8iIGshdedcjAbI6sQO+At +evcOqLypxnhGVlL2gQnf +-----END CERTIFICATE----- +*/ +const uint8_t kPaiPathLen1[447] = { + 0x30, 0x82, 0x01, 0xbb, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x12, 0x5d, 0xe4, 0xfb, 0x2c, 0xe4, + 0x42, 0xea, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x1a, 0x31, 0x18, 0x30, 0x16, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, + 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x33, 0x33, + 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x46, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, + 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x49, 0x31, 0x14, 0x30, + 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x32, 0x31, 0x14, + 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x02, 0x0c, 0x04, 0x38, 0x30, 0x30, 0x35, 0x30, + 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, + 0x07, 0x03, 0x42, 0x00, 0x04, 0x2c, 0xa3, 0x72, 0x51, 0x49, 0x16, 0xda, 0x99, 0x4b, 0x95, 0x93, 0x80, 0xb6, 0x6b, 0x27, 0x01, + 0xf4, 0xcf, 0x38, 0x08, 0xf3, 0x93, 0xf7, 0x16, 0xb1, 0x23, 0x89, 0xc2, 0xf9, 0x5a, 0x8a, 0xf2, 0xf4, 0x93, 0x26, 0x2a, 0x65, + 0xa0, 0xa3, 0xeb, 0xf8, 0x1b, 0xe0, 0x6a, 0x71, 0x07, 0x32, 0xa0, 0xaa, 0xa0, 0x2f, 0xf5, 0x28, 0xef, 0x95, 0x8b, 0xfd, 0x20, + 0x32, 0x63, 0x2f, 0xbd, 0x88, 0x5f, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, + 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xda, 0xd4, 0x67, 0x6f, 0x50, 0x6d, + 0x45, 0x43, 0xdb, 0x94, 0x76, 0xd6, 0x18, 0x69, 0x1c, 0x67, 0x49, 0x72, 0x8d, 0x08, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x78, 0x5c, 0xe7, 0x05, 0xb8, 0x6b, 0x8f, 0x4e, 0x6f, 0xc7, 0x93, 0xaa, 0x60, 0xcb, 0x43, + 0xea, 0x69, 0x68, 0x82, 0xd5, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, + 0x44, 0x02, 0x20, 0x62, 0xb7, 0x97, 0x73, 0x53, 0x72, 0xfb, 0x91, 0xd9, 0x45, 0x2c, 0x6a, 0x4f, 0x88, 0x0f, 0x54, 0xfe, 0x73, + 0xe5, 0x99, 0x21, 0x65, 0x75, 0x12, 0x61, 0x6e, 0xc6, 0x1d, 0xaa, 0xac, 0xf1, 0x50, 0x02, 0x20, 0x3f, 0xfc, 0x88, 0x81, 0xac, + 0x85, 0xd7, 0x9d, 0x72, 0x30, 0x1b, 0x23, 0xab, 0x10, 0x3b, 0xe0, 0x2d, 0x7a, 0xf7, 0x0e, 0xa8, 0xbc, 0xa9, 0xc6, 0x78, 0x46, + 0x56, 0x52, 0xf6, 0x81, 0x09, 0xdf, +}; + +/* +-----BEGIN CERTIFICATE----- +MIIBvDCCAWKgAwIBAgIIUU31T4F/bycwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMjAeFw0yMzA1Mjgx +NDIzNDNaFw0zMjA2MjcxNDIzNDJaMDAxGDAWBgNVBAMMD01hdHRlciBUZXN0IFBB +QTEUMBIGCisGAQQBgqJ8AgEMBEZGRjIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC +AAQjYtkTW7E7w26mNn1LTLN/93IZp/xgOrAGP9ye/8bPC166EyCmbvTjSBvKu+HM +UlUmt2r79bkb9Swzhg3GXxA5o2YwZDASBgNVHRMBAf8ECDAGAQH/AgECMA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUfx2q8kSYuYZoDqCPwYkh6EhInRcwHwYDVR0j +BBgwFoAUfx2q8kSYuYZoDqCPwYkh6EhInRcwCgYIKoZIzj0EAwIDSAAwRQIgbBOM +5XDzrA1cWOTHigR4go96aos4+W1pA8Irlj2LxRcCIQDje3+2Gvz7UW9rRkf8p/SG +NbKsuLiNm8I5idctQg3eaw== +-----END CERTIFICATE----- +*/ +const uint8_t kPaaPathLen2[448] = { + 0x30, 0x82, 0x01, 0xbc, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x51, 0x4d, 0xf5, 0x4f, 0x81, 0x7f, + 0x6f, 0x27, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, + 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, + 0x32, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x33, 0x30, 0x35, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x33, + 0x32, 0x30, 0x36, 0x32, 0x37, 0x31, 0x34, 0x32, 0x33, 0x34, 0x32, 0x5a, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, + 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x50, 0x41, 0x41, 0x31, 0x14, + 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x32, 0x30, + 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, + 0x07, 0x03, 0x42, 0x00, 0x04, 0x23, 0x62, 0xd9, 0x13, 0x5b, 0xb1, 0x3b, 0xc3, 0x6e, 0xa6, 0x36, 0x7d, 0x4b, 0x4c, 0xb3, 0x7f, + 0xf7, 0x72, 0x19, 0xa7, 0xfc, 0x60, 0x3a, 0xb0, 0x06, 0x3f, 0xdc, 0x9e, 0xff, 0xc6, 0xcf, 0x0b, 0x5e, 0xba, 0x13, 0x20, 0xa6, + 0x6e, 0xf4, 0xe3, 0x48, 0x1b, 0xca, 0xbb, 0xe1, 0xcc, 0x52, 0x55, 0x26, 0xb7, 0x6a, 0xfb, 0xf5, 0xb9, 0x1b, 0xf5, 0x2c, 0x33, + 0x86, 0x0d, 0xc6, 0x5f, 0x10, 0x39, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, + 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x02, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, + 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x7f, 0x1d, 0xaa, 0xf2, 0x44, 0x98, + 0xb9, 0x86, 0x68, 0x0e, 0xa0, 0x8f, 0xc1, 0x89, 0x21, 0xe8, 0x48, 0x48, 0x9d, 0x17, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x7f, 0x1d, 0xaa, 0xf2, 0x44, 0x98, 0xb9, 0x86, 0x68, 0x0e, 0xa0, 0x8f, 0xc1, 0x89, 0x21, + 0xe8, 0x48, 0x48, 0x9d, 0x17, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, + 0x45, 0x02, 0x20, 0x6c, 0x13, 0x8c, 0xe5, 0x70, 0xf3, 0xac, 0x0d, 0x5c, 0x58, 0xe4, 0xc7, 0x8a, 0x04, 0x78, 0x82, 0x8f, 0x7a, + 0x6a, 0x8b, 0x38, 0xf9, 0x6d, 0x69, 0x03, 0xc2, 0x2b, 0x96, 0x3d, 0x8b, 0xc5, 0x17, 0x02, 0x21, 0x00, 0xe3, 0x7b, 0x7f, 0xb6, + 0x1a, 0xfc, 0xfb, 0x51, 0x6f, 0x6b, 0x46, 0x47, 0xfc, 0xa7, 0xf4, 0x86, 0x35, 0xb2, 0xac, 0xb8, 0xb8, 0x8d, 0x9b, 0xc2, 0x39, + 0x89, 0xd7, 0x2d, 0x42, 0x0d, 0xde, 0x6b, +}; diff --git a/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp b/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp index 4ad79d22463f5a..e5fedf2d7f994d 100644 --- a/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp @@ -1227,9 +1227,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; + int isCA = 0; + int pathLen = -1; VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); extBasicPresent = true; @@ -1238,11 +1237,17 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); if (len > 0) { - result = mbedtls_asn1_get_bool(&p, end, &isCA); + unsigned char * seqStart = p; + result = mbedtls_asn1_get_bool(&p, end, &isCA); VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - if (p != seqStart + len) + // Check if pathLen is there by validating if the cursor didn't get to the end of + // of the internal SEQUENCE for the basic constraints encapsulation. + // Missing pathLen optional tag will leave pathLen == -1 for following checks. + bool hasPathLen = (p != (seqStart + len)); + if (hasPathLen) { + // Extract pathLen value, making sure it's a valid format. result = mbedtls_asn1_get_int(&p, end, &pathLen); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); } @@ -1258,7 +1263,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), error = CHIP_ERROR_INTERNAL); } } else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) diff --git a/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp b/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp index 771e2638a8a176..93c286c0edaa9f 100644 --- a/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp +++ b/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp @@ -1197,9 +1197,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; + int isCA = 0; + int pathLen = -1; VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); extBasicPresent = true; @@ -1208,11 +1207,17 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); if (len > 0) { - result = mbedtls_asn1_get_bool(&p, end, &isCA); + unsigned char * seqStart = p; + result = mbedtls_asn1_get_bool(&p, end, &isCA); VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - if (p != seqStart + len) + // Check if pathLen is there by validating if the cursor didn't get to the end of + // of the internal SEQUENCE for the basic constraints encapsulation. + // Missing pathLen optional tag will leave pathLen == -1 for following checks. + bool hasPathLen = (p != (seqStart + len)); + if (hasPathLen) { + // Extract pathLen value, making sure it's a valid format. result = mbedtls_asn1_get_int(&p, end, &pathLen); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); } @@ -1228,7 +1233,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), error = CHIP_ERROR_INTERNAL); } } else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) diff --git a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp index 192f691b497cfe..321aaac5363d19 100644 --- a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp @@ -1228,9 +1228,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; + int isCA = 0; + int pathLen = -1; VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); extBasicPresent = true; @@ -1239,11 +1238,17 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); if (len > 0) { - result = mbedtls_asn1_get_bool(&p, end, &isCA); + unsigned char * seqStart = p; + result = mbedtls_asn1_get_bool(&p, end, &isCA); VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - if (p != seqStart + len) + // Check if pathLen is there by validating if the cursor didn't get to the end of + // of the internal SEQUENCE for the basic constraints encapsulation. + // Missing pathLen optional tag will leave pathLen == -1 for following checks. + bool hasPathLen = (p != (seqStart + len)); + if (hasPathLen) { + // Extract pathLen value, making sure it's a valid format. result = mbedtls_asn1_get_int(&p, end, &pathLen); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); } @@ -1259,7 +1264,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), error = CHIP_ERROR_INTERNAL); } } else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) diff --git a/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp b/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp index 300348ef311e5a..63a7a17308ab13 100644 --- a/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp +++ b/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp @@ -1530,9 +1530,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; + int isCA = 0; + int pathLen = -1; VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); extBasicPresent = true; @@ -1541,11 +1540,17 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); if (len > 0) { - result = mbedtls_asn1_get_bool(&p, end, &isCA); + unsigned char * seqStart = p; + result = mbedtls_asn1_get_bool(&p, end, &isCA); VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - if (p != seqStart + len) + // Check if pathLen is there by validating if the cursor didn't get to the end of + // of the internal SEQUENCE for the basic constraints encapsulation. + // Missing pathLen optional tag will leave pathLen == -1 for following checks. + bool hasPathLen = (p != (seqStart + len)); + if (hasPathLen) { + // Extract pathLen value, making sure it's a valid format. result = mbedtls_asn1_get_int(&p, end, &pathLen); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); } @@ -1561,7 +1566,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation } else { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); + // For PAA, pathlen must be absent or equal to 1 (see Matter 1.1 spec 6.2.2.5) + VerifyOrExit(isCA && (pathLen == -1 || pathLen == 1), error = CHIP_ERROR_INTERNAL); } } else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) From 48b97e03a6b335f60d12a03a9c5235049e62d728 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 15 Jun 2023 09:41:38 +0200 Subject: [PATCH 06/31] [matter_yamltests] Add SpecDefinitions.get_cluster_names to get all the cluster names (#27252) --- scripts/py_matter_yamltests/matter_yamltests/definitions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/py_matter_yamltests/matter_yamltests/definitions.py b/scripts/py_matter_yamltests/matter_yamltests/definitions.py index 8597262d1a06d9..03a791b62d1006 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/definitions.py +++ b/scripts/py_matter_yamltests/matter_yamltests/definitions.py @@ -87,6 +87,9 @@ def __init__(self, sources: List[ParseSource]): self.__responses_by_id[code][struct.code] = struct self.__responses_by_name[name][struct.name] = struct.code + def get_cluster_names(self) -> List[str]: + return [name for name, _ in self.__clusters_by_name.items()] + def get_cluster_name(self, cluster_id: int) -> str: cluster = self.__clusters_by_id.get(cluster_id) return cluster.name if cluster else None From 2eef7302ccb407d00a71dfda9f633ec3afb28e29 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 15 Jun 2023 09:42:00 +0200 Subject: [PATCH 07/31] [chip-tool] Translate all ById command properly even when the cluster is not Any (#27251) --- .../matter_chip_tool_adapter/encoder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index f060a50c7604a4..2b5463412e4f43 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -34,8 +34,7 @@ _ALIASES = { - 'AnyCommands': { - 'alias': 'any', + '*': { 'commands': { 'CommandById': { 'alias': 'command-by-id', @@ -98,6 +97,9 @@ }, } }, + 'AnyCommands': { + 'alias': 'any', + }, 'CommissionerCommands': { 'alias': 'pairing', 'commands': { @@ -313,7 +315,7 @@ def __get_argument_name(self, request, entry): else: argument_name = 'value' - return self.__get_alias(cluster_name, command_name, argument_name) or argument_name + return self.__get_alias('*', command_name, argument_name) or self.__get_alias(cluster_name, command_name, argument_name) or argument_name def __maybe_add(self, rv, value, name): if value is None: From 815c2aea8993e3165452d516f2a6fd762445d70d Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 15 Jun 2023 14:30:37 +0200 Subject: [PATCH 08/31] [matter_yamltests] Reproduce the c++ behavior for hasMasksSet (#27253) --- .../matter_yamltests/constraints.py | 2 +- src/app/tests/suites/TestConstraints.yaml | 16 + .../chip-tool/zap-generated/test/Commands.h | 249 +++++++++------- .../zap-generated/test/Commands.h | 273 +++++++++++------- 4 files changed, 320 insertions(+), 220 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/constraints.py b/scripts/py_matter_yamltests/matter_yamltests/constraints.py index 93558330e18ed6..406287dd497c60 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/constraints.py +++ b/scripts/py_matter_yamltests/matter_yamltests/constraints.py @@ -728,7 +728,7 @@ def __init__(self, context, has_masks_set): self._has_masks_set = has_masks_set def check_response(self, value, value_type_name) -> bool: - return all([(value & mask) == mask for mask in self._has_masks_set]) + return all([(value & mask) != 0 for mask in self._has_masks_set]) def get_reason(self, value, value_type_name) -> str: expected_masks = [] diff --git a/src/app/tests/suites/TestConstraints.yaml b/src/app/tests/suites/TestConstraints.yaml index 60b88ead227c65..aa1896d7ebd94e 100644 --- a/src/app/tests/suites/TestConstraints.yaml +++ b/src/app/tests/suites/TestConstraints.yaml @@ -112,6 +112,22 @@ tests: constraints: hasMasksSet: [0x01, 0x04] # [MaskVal1, MaskVal3] + - label: "Write attribute BITMAP32 with MaskVal1" + command: "writeAttribute" + attribute: "bitmap32" + arguments: + value: 1 # MaskVal1 + + - label: + "Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 + are set" + command: "readAttribute" + attribute: "bitmap32" + response: + value: 1 # MaskVal1 + constraints: + hasMasksSet: [0x05] # [MaskVal1, MaskVal3] + - label: "Write attribute BITMAP32 Back to Default Value" command: "writeAttribute" attribute: "bitmap32" diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index ac13daf482c5f8..bd8f0f92d82a80 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -72397,7 +72397,7 @@ class TestClusterComplexTypesSuite : public TestCommand class TestConstraintsSuite : public TestCommand { public: - TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 55, credsIssuerConfig) + TestConstraintsSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestConstraints", 57, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -72512,8 +72512,20 @@ class TestConstraintsSuite : public TestCommand break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::BitMask value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("bitmap32", value, 1UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 5UL)); + } break; case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -72521,7 +72533,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMinValue("value", value, 5UL)); } break; - case 14: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -72529,7 +72541,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 5UL)); } break; - case 15: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint32_t value; @@ -72537,13 +72549,13 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintNotValue("value", value, 6UL)); } break; - case 16: + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 18: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -72551,7 +72563,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMinLength("value", value, 5)); } break; - case 19: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -72559,7 +72571,7 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintMaxLength("value", value, 20)); } break; - case 20: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; @@ -72567,24 +72579,12 @@ class TestConstraintsSuite : public TestCommand VerifyOrReturn(CheckConstraintStartsWith("value", value, "**")); } break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::CharSpan value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintEndsWith("value", value, "**")); - } - break; - case 22: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintEndsWith("value", value, "**")); } break; case 24: @@ -72595,8 +72595,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); } break; case 26: @@ -72607,7 +72607,7 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; @@ -72619,8 +72619,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; case 30: @@ -72644,7 +72644,7 @@ class TestConstraintsSuite : public TestCommand chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 34: @@ -72655,8 +72655,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); - VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, false)); } break; case 36: @@ -72667,7 +72667,7 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, false)); VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; @@ -72679,7 +72679,8 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsHexString("value", value, false)); + VerifyOrReturn(CheckConstraintIsUpperCase("value", value, true)); + VerifyOrReturn(CheckConstraintIsLowerCase("value", value, true)); } break; case 40: @@ -72690,7 +72691,7 @@ class TestConstraintsSuite : public TestCommand { chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintIsHexString("value", value, true)); + VerifyOrReturn(CheckConstraintIsHexString("value", value, false)); } break; case 42: @@ -72699,10 +72700,9 @@ class TestConstraintsSuite : public TestCommand case 43: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 0U)); + VerifyOrReturn(CheckConstraintIsHexString("value", value, true)); } break; case 44: @@ -72713,6 +72713,8 @@ class TestConstraintsSuite : public TestCommand { chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableInt8u", value)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", value.Value(), 0U)); } break; case 46: @@ -72731,11 +72733,8 @@ class TestConstraintsSuite : public TestCommand case 49: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), - chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); } break; case 50: @@ -72746,6 +72745,9 @@ class TestConstraintsSuite : public TestCommand { chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", value)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", value.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); } break; case 52: @@ -72761,6 +72763,16 @@ class TestConstraintsSuite : public TestCommand case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -72853,82 +72865,82 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 11: { - LogStep(11, "Write attribute BITMAP32 Back to Default Value"); + LogStep(11, "Write attribute BITMAP32 with MaskVal1"); ListFreer listFreer; chip::BitMask value; - value = static_cast>(0UL); + value = static_cast>(1UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, chip::NullOptional, chip::NullOptional); } case 12: { - LogStep(12, "Write attribute INT32U Value"); + LogStep(12, "Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Write attribute BITMAP32 Back to Default Value"); + ListFreer listFreer; + chip::BitMask value; + value = static_cast>(0UL); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Bitmap32::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, "Write attribute INT32U Value"); ListFreer listFreer; uint32_t value; value = 5UL; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, chip::NullOptional, chip::NullOptional); } - case 13: { - LogStep(13, "Read attribute INT32U Value MinValue Constraints"); + case 15: { + LogStep(15, "Read attribute INT32U Value MinValue Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "Read attribute INT32U Value MaxValue Constraints"); + case 16: { + LogStep(16, "Read attribute INT32U Value MaxValue Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Read attribute INT32U Value NotValue Constraints"); + case 17: { + LogStep(17, "Read attribute INT32U Value NotValue Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Write attribute INT32U Value Back to Default Value"); + case 18: { + LogStep(18, "Write attribute INT32U Value Back to Default Value"); ListFreer listFreer; uint32_t value; value = 0UL; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::Int32u::Id, value, chip::NullOptional, chip::NullOptional); } - case 17: { - LogStep(17, "Write attribute CHAR_STRING Value"); + case 19: { + LogStep(19, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; value = chip::Span("** Test **garbage: not in length on purpose", 10); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } - case 18: { - LogStep(18, "Read attribute CHAR_STRING Value MinLength Constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, - chip::NullOptional); - } - case 19: { - LogStep(19, "Read attribute CHAR_STRING Value MaxLength Constraints"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, - chip::NullOptional); - } case 20: { - LogStep(20, "Read attribute CHAR_STRING Value StartsWith Constraints"); + LogStep(20, "Read attribute CHAR_STRING Value MinLength Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 21: { - LogStep(21, "Read attribute CHAR_STRING Value EndsWith Constraints"); + LogStep(21, "Read attribute CHAR_STRING Value MaxLength Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 22: { - LogStep(22, "Write attribute CHAR_STRING Value"); - ListFreer listFreer; - chip::CharSpan value; - value = chip::Span("lowercasegarbage: not in length on purpose", 9); - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, - chip::NullOptional, chip::NullOptional); + LogStep(22, "Read attribute CHAR_STRING Value StartsWith Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, + chip::NullOptional); } case 23: { - LogStep(23, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); + LogStep(23, "Read attribute CHAR_STRING Value EndsWith Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } @@ -72936,7 +72948,7 @@ class TestConstraintsSuite : public TestCommand LogStep(24, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("UPPERCASEgarbage: not in length on purpose", 9); + value = chip::Span("lowercasegarbage: not in length on purpose", 9); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72949,7 +72961,7 @@ class TestConstraintsSuite : public TestCommand LogStep(26, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("lowUPPERgarbage: not in length on purpose", 8); + value = chip::Span("UPPERCASEgarbage: not in length on purpose", 9); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72959,10 +72971,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 28: { - LogStep(28, "Write attribute CHAR_STRING Value with only digits"); + LogStep(28, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("1234567890garbage: not in length on purpose", 10); + value = chip::Span("lowUPPERgarbage: not in length on purpose", 8); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72972,10 +72984,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 30: { - LogStep(30, "Write attribute CHAR_STRING Value with only non-letters"); + LogStep(30, "Write attribute CHAR_STRING Value with only digits"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("12.4,76:garbage: not in length on purpose", 8); + value = chip::Span("1234567890garbage: not in length on purpose", 10); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72985,10 +72997,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 32: { - LogStep(32, "Write attribute CHAR_STRING Value with uppercase letters and symbols"); + LogStep(32, "Write attribute CHAR_STRING Value with only non-letters"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABC;.* garbage: not in length on purpose", 7); + value = chip::Span("12.4,76:garbage: not in length on purpose", 8); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -72998,10 +73010,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 34: { - LogStep(34, "Write attribute CHAR_STRING Value with lowercase letters and symbols"); + LogStep(34, "Write attribute CHAR_STRING Value with uppercase letters and symbols"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("abc;.* garbage: not in length on purpose", 7); + value = chip::Span("ABC;.* garbage: not in length on purpose", 7); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -73011,10 +73023,10 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 36: { - LogStep(36, "Write attribute CHAR_STRING Value which is empty"); + LogStep(36, "Write attribute CHAR_STRING Value with lowercase letters and symbols"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("garbage: not in length on purpose", 0); + value = chip::Span("abc;.* garbage: not in length on purpose", 7); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -73024,15 +73036,15 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 38: { - LogStep(38, "Write attribute CHAR_STRING Value"); + LogStep(38, "Write attribute CHAR_STRING Value which is empty"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); + value = chip::Span("garbage: not in length on purpose", 0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } case 39: { - LogStep(39, "Read attribute CHAR_STRING Value isHexString Constraints"); + LogStep(39, "Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } @@ -73040,7 +73052,7 @@ class TestConstraintsSuite : public TestCommand LogStep(40, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); + value = chip::Span("ABCDEF012Vgarbage: not in length on purpose", 10); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } @@ -73050,20 +73062,33 @@ class TestConstraintsSuite : public TestCommand chip::NullOptional); } case 42: { - LogStep(42, "Write attribute CHAR_STRING Value Back to Default Value"); + LogStep(42, "Write attribute CHAR_STRING Value"); ListFreer listFreer; chip::CharSpan value; - value = chip::Span("garbage: not in length on purpose", 0); + value = chip::Span("ABCDEF0123garbage: not in length on purpose", 10); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, chip::NullOptional, chip::NullOptional); } case 43: { - LogStep(43, "Read attribute NULLABLE_INT8U Default Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + LogStep(43, "Read attribute CHAR_STRING Value isHexString Constraints"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, true, chip::NullOptional); } case 44: { - LogStep(44, "Write attribute NULLABLE_INT8U with a value"); + LogStep(44, "Write attribute CHAR_STRING Value Back to Default Value"); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("garbage: not in length on purpose", 0); + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::CharString::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 45: { + LogStep(45, "Read attribute NULLABLE_INT8U Default Value"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, + chip::NullOptional); + } + case 46: { + LogStep(46, "Write attribute NULLABLE_INT8U with a value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -73071,26 +73096,26 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 45: { - LogStep(45, "Read attribute NULLABLE_INT8U with a value"); + case 47: { + LogStep(47, "Read attribute NULLABLE_INT8U with a value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, chip::NullOptional); } - case 46: { - LogStep(46, "Write attribute NULLABLE_INT8U without a value"); + case 48: { + LogStep(48, "Write attribute NULLABLE_INT8U without a value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 47: { - LogStep(47, "Read attribute NULLABLE_INT8U with a value"); + case 49: { + LogStep(49, "Read attribute NULLABLE_INT8U with a value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, true, chip::NullOptional); } - case 48: { - LogStep(48, "Write attribute NULLABLE_INT8U back to Default Value"); + case 50: { + LogStep(50, "Write attribute NULLABLE_INT8U back to Default Value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -73098,13 +73123,13 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableInt8u::Id, value, chip::NullOptional, chip::NullOptional); } - case 49: { - LogStep(49, "Read attribute NULLABLE_OCTET_STRING Default Value"); + case 51: { + LogStep(51, "Read attribute NULLABLE_OCTET_STRING Default Value"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 50: { - LogStep(50, "Write attribute NULLABLE_OCTET_STRING"); + case 52: { + LogStep(52, "Write attribute NULLABLE_OCTET_STRING"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -73112,26 +73137,26 @@ class TestConstraintsSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, value, chip::NullOptional, chip::NullOptional); } - case 51: { - LogStep(51, "Read attribute NULLABLE_OCTET_STRING"); + case 53: { + LogStep(53, "Read attribute NULLABLE_OCTET_STRING"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 52: { - LogStep(52, "Write attribute NULLABLE_OCTET_STRING"); + case 54: { + LogStep(54, "Write attribute NULLABLE_OCTET_STRING"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, value, chip::NullOptional, chip::NullOptional); } - case 53: { - LogStep(53, "Read attribute NULLABLE_OCTET_STRING"); + case 55: { + LogStep(55, "Read attribute NULLABLE_OCTET_STRING"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), UnitTesting::Id, UnitTesting::Attributes::NullableOctetString::Id, true, chip::NullOptional); } - case 54: { - LogStep(54, "Write attribute NULLABLE_OCTET_STRING back to Default Value"); + case 56: { + LogStep(56, "Write attribute NULLABLE_OCTET_STRING back to Default Value"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); 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 025c152bed88cc..019717e676f697 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -104166,57 +104166,57 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeBitmap32WithMaskVal1AndMaskVal3AndEnsureMaskval1AndMaskVal3AreSet_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute BITMAP32 Back to Default Value\n"); - err = TestWriteAttributeBitmap32BackToDefaultValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Write attribute BITMAP32 with MaskVal1\n"); + err = TestWriteAttributeBitmap32WithMaskVal1_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Write attribute INT32U Value\n"); - err = TestWriteAttributeInt32uValue_12(); + ChipLogProgress( + chipTool, " ***** Test Step 12 : Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set\n"); + err = TestReadAttributeBitmap32WithMaskVal1AndEnsureMaskval1OrMaskVal3AreSet_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Read attribute INT32U Value MinValue Constraints\n"); - err = TestReadAttributeInt32uValueMinValueConstraints_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Write attribute BITMAP32 Back to Default Value\n"); + err = TestWriteAttributeBitmap32BackToDefaultValue_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Read attribute INT32U Value MaxValue Constraints\n"); - err = TestReadAttributeInt32uValueMaxValueConstraints_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Write attribute INT32U Value\n"); + err = TestWriteAttributeInt32uValue_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute INT32U Value NotValue Constraints\n"); - err = TestReadAttributeInt32uValueNotValueConstraints_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Read attribute INT32U Value MinValue Constraints\n"); + err = TestReadAttributeInt32uValueMinValueConstraints_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Write attribute INT32U Value Back to Default Value\n"); - err = TestWriteAttributeInt32uValueBackToDefaultValue_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Read attribute INT32U Value MaxValue Constraints\n"); + err = TestReadAttributeInt32uValueMaxValueConstraints_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Read attribute INT32U Value NotValue Constraints\n"); + err = TestReadAttributeInt32uValueNotValueConstraints_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Read attribute CHAR_STRING Value MinLength Constraints\n"); - err = TestReadAttributeCharStringValueMinLengthConstraints_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Write attribute INT32U Value Back to Default Value\n"); + err = TestWriteAttributeInt32uValueBackToDefaultValue_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); - err = TestReadAttributeCharStringValueMaxLengthConstraints_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); - err = TestReadAttributeCharStringValueStartsWithConstraints_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Read attribute CHAR_STRING Value MinLength Constraints\n"); + err = TestReadAttributeCharStringValueMinLengthConstraints_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); - err = TestReadAttributeCharStringValueEndsWithConstraints_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Read attribute CHAR_STRING Value MaxLength Constraints\n"); + err = TestReadAttributeCharStringValueMaxLengthConstraints_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Read attribute CHAR_STRING Value StartsWith Constraints\n"); + err = TestReadAttributeCharStringValueStartsWithConstraints_22(); break; case 23: - ChipLogProgress( - chipTool, " ***** Test Step 23 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); - err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Read attribute CHAR_STRING Value EndsWith Constraints\n"); + err = TestReadAttributeCharStringValueEndsWithConstraints_23(); break; case 24: ChipLogProgress(chipTool, " ***** Test Step 24 : Write attribute CHAR_STRING Value\n"); @@ -104237,8 +104237,8 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute CHAR_STRING Value with only digits\n"); - err = TestWriteAttributeCharStringValueWithOnlyDigits_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_28(); break; case 29: ChipLogProgress( @@ -104246,8 +104246,8 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute CHAR_STRING Value with only non-letters\n"); - err = TestWriteAttributeCharStringValueWithOnlyNonLetters_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Write attribute CHAR_STRING Value with only digits\n"); + err = TestWriteAttributeCharStringValueWithOnlyDigits_30(); break; case 31: ChipLogProgress( @@ -104255,9 +104255,8 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31(); break; case 32: - ChipLogProgress( - chipTool, " ***** Test Step 32 : Write attribute CHAR_STRING Value with uppercase letters and symbols\n"); - err = TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_32(); + ChipLogProgress(chipTool, " ***** Test Step 32 : Write attribute CHAR_STRING Value with only non-letters\n"); + err = TestWriteAttributeCharStringValueWithOnlyNonLetters_32(); break; case 33: ChipLogProgress( @@ -104266,8 +104265,8 @@ class TestConstraints : public TestCommandBridge { break; case 34: ChipLogProgress( - chipTool, " ***** Test Step 34 : Write attribute CHAR_STRING Value with lowercase letters and symbols\n"); - err = TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_34(); + chipTool, " ***** Test Step 34 : Write attribute CHAR_STRING Value with uppercase letters and symbols\n"); + err = TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_34(); break; case 35: ChipLogProgress( @@ -104275,8 +104274,9 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35(); break; case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : Write attribute CHAR_STRING Value which is empty\n"); - err = TestWriteAttributeCharStringValueWhichIsEmpty_36(); + ChipLogProgress( + chipTool, " ***** Test Step 36 : Write attribute CHAR_STRING Value with lowercase letters and symbols\n"); + err = TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_36(); break; case 37: ChipLogProgress( @@ -104284,12 +104284,13 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37(); break; case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute CHAR_STRING Value\n"); - err = TestWriteAttributeCharStringValue_38(); + ChipLogProgress(chipTool, " ***** Test Step 38 : Write attribute CHAR_STRING Value which is empty\n"); + err = TestWriteAttributeCharStringValueWhichIsEmpty_38(); break; case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : Read attribute CHAR_STRING Value isHexString Constraints\n"); - err = TestReadAttributeCharStringValueIsHexStringConstraints_39(); + ChipLogProgress( + chipTool, " ***** Test Step 39 : Read attribute CHAR_STRING Value isLowerCase/isUpperCase Constraints\n"); + err = TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_39(); break; case 40: ChipLogProgress(chipTool, " ***** Test Step 40 : Write attribute CHAR_STRING Value\n"); @@ -104300,44 +104301,44 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeCharStringValueIsHexStringConstraints_41(); break; case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute CHAR_STRING Value Back to Default Value\n"); - err = TestWriteAttributeCharStringValueBackToDefaultValue_42(); + ChipLogProgress(chipTool, " ***** Test Step 42 : Write attribute CHAR_STRING Value\n"); + err = TestWriteAttributeCharStringValue_42(); break; case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute NULLABLE_INT8U Default Value\n"); - err = TestReadAttributeNullableInt8uDefaultValue_43(); + ChipLogProgress(chipTool, " ***** Test Step 43 : Read attribute CHAR_STRING Value isHexString Constraints\n"); + err = TestReadAttributeCharStringValueIsHexStringConstraints_43(); break; case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute NULLABLE_INT8U with a value\n"); - err = TestWriteAttributeNullableInt8uWithAValue_44(); + ChipLogProgress(chipTool, " ***** Test Step 44 : Write attribute CHAR_STRING Value Back to Default Value\n"); + err = TestWriteAttributeCharStringValueBackToDefaultValue_44(); break; case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute NULLABLE_INT8U with a value\n"); - err = TestReadAttributeNullableInt8uWithAValue_45(); + ChipLogProgress(chipTool, " ***** Test Step 45 : Read attribute NULLABLE_INT8U Default Value\n"); + err = TestReadAttributeNullableInt8uDefaultValue_45(); break; case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute NULLABLE_INT8U without a value\n"); - err = TestWriteAttributeNullableInt8uWithoutAValue_46(); + ChipLogProgress(chipTool, " ***** Test Step 46 : Write attribute NULLABLE_INT8U with a value\n"); + err = TestWriteAttributeNullableInt8uWithAValue_46(); break; case 47: ChipLogProgress(chipTool, " ***** Test Step 47 : Read attribute NULLABLE_INT8U with a value\n"); err = TestReadAttributeNullableInt8uWithAValue_47(); break; case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : Write attribute NULLABLE_INT8U back to Default Value\n"); - err = TestWriteAttributeNullableInt8uBackToDefaultValue_48(); + ChipLogProgress(chipTool, " ***** Test Step 48 : Write attribute NULLABLE_INT8U without a value\n"); + err = TestWriteAttributeNullableInt8uWithoutAValue_48(); break; case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_49(); + ChipLogProgress(chipTool, " ***** Test Step 49 : Read attribute NULLABLE_INT8U with a value\n"); + err = TestReadAttributeNullableInt8uWithAValue_49(); break; case 50: - ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_50(); + ChipLogProgress(chipTool, " ***** Test Step 50 : Write attribute NULLABLE_INT8U back to Default Value\n"); + err = TestWriteAttributeNullableInt8uBackToDefaultValue_50(); break; case 51: - ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_51(); + ChipLogProgress(chipTool, " ***** Test Step 51 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_51(); break; case 52: ChipLogProgress(chipTool, " ***** Test Step 52 : Write attribute NULLABLE_OCTET_STRING\n"); @@ -104348,8 +104349,16 @@ class TestConstraints : public TestCommandBridge { err = TestReadAttributeNullableOctetString_53(); break; case 54: - ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute NULLABLE_OCTET_STRING back to Default Value\n"); - err = TestWriteAttributeNullableOctetStringBackToDefaultValue_54(); + ChipLogProgress(chipTool, " ***** Test Step 54 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_54(); + break; + case 55: + ChipLogProgress(chipTool, " ***** Test Step 55 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_55(); + break; + case 56: + ChipLogProgress(chipTool, " ***** Test Step 56 : Write attribute NULLABLE_OCTET_STRING back to Default Value\n"); + err = TestWriteAttributeNullableOctetStringBackToDefaultValue_56(); break; } @@ -104527,6 +104536,12 @@ class TestConstraints : public TestCommandBridge { case 54: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -104540,7 +104555,7 @@ class TestConstraints : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 55; + const uint16_t mTestCount = 57; chip::Optional mNodeId; chip::Optional mCluster; @@ -104786,7 +104801,51 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeBitmap32BackToDefaultValue_11() + CHIP_ERROR TestWriteAttributeBitmap32WithMaskVal1_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id bitmap32Argument; + bitmap32Argument = [NSNumber numberWithUnsignedInt:1UL]; + [cluster writeAttributeBitmap32WithValue:bitmap32Argument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute BITMAP32 with MaskVal1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeBitmap32WithMaskVal1AndEnsureMaskval1OrMaskVal3AreSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBitmap32WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute BITMAP32 with MaskVal1 and ensure Maskval1 or MaskVal3 are set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("bitmap32", actualValue, 1UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeBitmap32BackToDefaultValue_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104807,7 +104866,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValue_12() + CHIP_ERROR TestWriteAttributeInt32uValue_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104828,7 +104887,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_13() + CHIP_ERROR TestReadAttributeInt32uValueMinValueConstraints_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104848,7 +104907,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_14() + CHIP_ERROR TestReadAttributeInt32uValueMaxValueConstraints_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104868,7 +104927,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_15() + CHIP_ERROR TestReadAttributeInt32uValueNotValueConstraints_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104888,7 +104947,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_16() + CHIP_ERROR TestWriteAttributeInt32uValueBackToDefaultValue_18() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104909,7 +104968,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_17() + CHIP_ERROR TestWriteAttributeCharStringValue_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104930,7 +104989,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_18() + CHIP_ERROR TestReadAttributeCharStringValueMinLengthConstraints_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104949,7 +105008,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_19() + CHIP_ERROR TestReadAttributeCharStringValueMaxLengthConstraints_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104968,7 +105027,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_20() + CHIP_ERROR TestReadAttributeCharStringValueStartsWithConstraints_22() { MTRBaseDevice * device = GetDevice("alpha"); @@ -104987,7 +105046,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_21() + CHIP_ERROR TestReadAttributeCharStringValueEndsWithConstraints_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105006,7 +105065,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_22() + CHIP_ERROR TestWriteAttributeCharStringValue_24() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105027,7 +105086,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_23() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_25() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105047,7 +105106,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_24() + CHIP_ERROR TestWriteAttributeCharStringValue_26() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105068,7 +105127,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_25() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105088,7 +105147,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_26() + CHIP_ERROR TestWriteAttributeCharStringValue_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105109,7 +105168,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_27() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105129,7 +105188,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyDigits_28() + CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyDigits_30() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105150,7 +105209,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_29() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105170,7 +105229,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyNonLetters_30() + CHIP_ERROR TestWriteAttributeCharStringValueWithOnlyNonLetters_32() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105191,7 +105250,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_31() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_33() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105211,7 +105270,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_32() + CHIP_ERROR TestWriteAttributeCharStringValueWithUppercaseLettersAndSymbols_34() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105233,7 +105292,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_33() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105253,7 +105312,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_34() + CHIP_ERROR TestWriteAttributeCharStringValueWithLowercaseLettersAndSymbols_36() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105275,7 +105334,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_35() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105295,7 +105354,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueWhichIsEmpty_36() + CHIP_ERROR TestWriteAttributeCharStringValueWhichIsEmpty_38() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105316,7 +105375,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_37() + CHIP_ERROR TestReadAttributeCharStringValueIsLowerCaseIsUpperCaseConstraints_39() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105336,7 +105395,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_38() + CHIP_ERROR TestWriteAttributeCharStringValue_40() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105357,7 +105416,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_39() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_41() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105376,7 +105435,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValue_40() + CHIP_ERROR TestWriteAttributeCharStringValue_42() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105397,7 +105456,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_41() + CHIP_ERROR TestReadAttributeCharStringValueIsHexStringConstraints_43() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105416,7 +105475,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_42() + CHIP_ERROR TestWriteAttributeCharStringValueBackToDefaultValue_44() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105437,7 +105496,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uDefaultValue_43() + CHIP_ERROR TestReadAttributeNullableInt8uDefaultValue_45() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105461,7 +105520,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uWithAValue_44() + CHIP_ERROR TestWriteAttributeNullableInt8uWithAValue_46() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105482,7 +105541,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_45() + CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_47() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105503,7 +105562,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uWithoutAValue_46() + CHIP_ERROR TestWriteAttributeNullableInt8uWithoutAValue_48() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105524,7 +105583,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_47() + CHIP_ERROR TestReadAttributeNullableInt8uWithAValue_49() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105545,7 +105604,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableInt8uBackToDefaultValue_48() + CHIP_ERROR TestWriteAttributeNullableInt8uBackToDefaultValue_50() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105566,7 +105625,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_49() + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_51() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105591,7 +105650,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_50() + CHIP_ERROR TestWriteAttributeNullableOctetString_52() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105612,7 +105671,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_51() + CHIP_ERROR TestReadAttributeNullableOctetString_53() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105633,7 +105692,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetString_52() + CHIP_ERROR TestWriteAttributeNullableOctetString_54() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105654,7 +105713,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadAttributeNullableOctetString_53() + CHIP_ERROR TestReadAttributeNullableOctetString_55() { MTRBaseDevice * device = GetDevice("alpha"); @@ -105675,7 +105734,7 @@ class TestConstraints : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableOctetStringBackToDefaultValue_54() + CHIP_ERROR TestWriteAttributeNullableOctetStringBackToDefaultValue_56() { MTRBaseDevice * device = GetDevice("alpha"); From 395e404d0b46a7096cbe1cd1eaa34eab7c8a1011 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Thu, 15 Jun 2023 20:59:23 +0800 Subject: [PATCH 09/31] [Ameba] Error mapping & update ci to 0.7.14 (#26573) * implement error mapping from ameba to matter * [Ameba] update ci to 0.7.14 --- .github/workflows/examples-ameba.yaml | 2 +- src/platform/Ameba/AmebaConfig.cpp | 227 +++++++++++------- src/platform/Ameba/AmebaUtils.cpp | 99 ++++++-- src/platform/Ameba/AmebaUtils.h | 15 ++ .../Ameba/ConfigurationManagerImpl.cpp | 23 +- .../Ameba/ConnectivityManagerImpl.cpp | 6 +- .../Ameba/DiagnosticDataProviderImpl.cpp | 61 +++-- src/platform/Ameba/FactoryDataDecoder.cpp | 19 +- .../Ameba/KeyValueStoreManagerImpl.cpp | 77 +++--- .../Ameba/NetworkCommissioningWiFiDriver.cpp | 21 +- src/platform/Ameba/PlatformManagerImpl.cpp | 2 +- src/platform/Ameba/SystemTimeSupport.cpp | 12 +- 12 files changed, 353 insertions(+), 211 deletions(-) diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index e188826740668f..0e3d2e867ac431 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ameba:0.7.3 + image: connectedhomeip/chip-build-ameba:0.7.14 options: --user root steps: diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index 08d552f440fd76..e91905ef17fd10 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include #include @@ -35,6 +37,8 @@ enum kPrefsTypeBinary = 5 }; +using namespace chip::DeviceLayer::PersistedStorage; + namespace chip { namespace DeviceLayer { namespace Internal { @@ -84,114 +88,112 @@ const AmebaConfig::Key AmebaConfig::kCounterKey_BootReason = { kConfi CHIP_ERROR AmebaConfig::ReadConfigValue(Key key, bool & val) { + CHIP_ERROR err; + int32_t error; uint8_t intVal; - int32_t success = 0; - success = getPref_bool_new(key.Namespace, key.Name, &intVal); - if (success != 0) + error = getPref_bool_new(key.Namespace, key.Name, &intVal); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "getPref_bool_new: %s/%s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); } val = (intVal != 0); - - if (success == 0) - return CHIP_NO_ERROR; - else - return CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; + return err; } CHIP_ERROR AmebaConfig::ReadConfigValue(Key key, uint32_t & val) { - int32_t success = 0; + CHIP_ERROR err; + int32_t error; - success = getPref_u32_new(key.Namespace, key.Name, &val); - if (success != 0) + error = getPref_u32_new(key.Namespace, key.Name, &val); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "getPref_u32_new: %s/%s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); } - if (success == 0) - return CHIP_NO_ERROR; - else - return CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; + return err; } CHIP_ERROR AmebaConfig::ReadConfigValue(Key key, uint64_t & val) { - int32_t success = 0; + CHIP_ERROR err; + int32_t error; - success = getPref_u64_new(key.Namespace, key.Name, &val); - if (success != 0) + error = getPref_u64_new(key.Namespace, key.Name, &val); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { - ChipLogProgress(DeviceLayer, "getPref_u32_new: %s/%s failed\n", StringOrNullMarker(key.Namespace), + ChipLogProgress(DeviceLayer, "getPref_u64: %s/%s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); } - if (success == 0) - return CHIP_NO_ERROR; - else - return CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; + return err; } CHIP_ERROR AmebaConfig::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) { - int32_t success = 0; + CHIP_ERROR err; + int32_t error; - success = getPref_str_new(key.Namespace, key.Name, buf, bufSize, &outLen); - if (success != 0) + error = getPref_str_new(key.Namespace, key.Name, buf, bufSize, &outLen); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + outLen -= 1; // Don't count trailing null + if (err != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "getPref_str_new: %s/%s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); - } - - if (success == 0) - { - outLen -= 1; // Don't count trailing null - return CHIP_NO_ERROR; - } - else - { outLen = 0; - return CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; } + + return err; } CHIP_ERROR AmebaConfig::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) { - int32_t success = 0; + CHIP_ERROR err; + int32_t error; - success = getPref_bin_new(key.Namespace, key.Name, buf, bufSize, &outLen); - if (success != 0) + error = getPref_bin_new(key.Namespace, key.Name, buf, bufSize, &outLen); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "getPref_bin_new: %s/%s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); - } - - if (success == 0) - { - return CHIP_NO_ERROR; - } - else - { outLen = 0; - return CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; } + + return err; } CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, bool val) { - int32_t success; + CHIP_ERROR err; + int32_t error; uint8_t value; if (val == 1) value = 1; else value = 0; - success = setPref_new(key.Namespace, key.Name, &value, 1); - if (!success) + + if (checkExist(key.Name, key.Name)) + { + err = ClearConfigValue(key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Warning, KVS leakage, failed to remove old KVS value"); + } + } + + error = setPref_new(key.Namespace, key.Name, &value, 1); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "setPref: %s/%s = %s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), value ? "true" : "false"); @@ -202,15 +204,26 @@ CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, bool val) val ? "true" : "false"); } - return CHIP_NO_ERROR; + return err; } CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, uint32_t val) { - int32_t success; + CHIP_ERROR err; + int32_t error; - success = setPref_new(key.Namespace, key.Name, (uint8_t *) &val, sizeof(uint32_t)); - if (!success) + if (checkExist(key.Name, key.Name)) + { + err = ClearConfigValue(key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Warning, KVS leakage, failed to remove old KVS value"); + } + } + + error = setPref_new(key.Namespace, key.Name, (uint8_t *) &val, sizeof(uint32_t)); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "setPref: %s/%s = %d(0x%x) failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), val, val); @@ -221,15 +234,26 @@ CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, uint32_t val) StringOrNullMarker(key.Name), val, val); } - return CHIP_NO_ERROR; + return err; } CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, uint64_t val) { - int32_t success; + CHIP_ERROR err; + int32_t error; + + if (checkExist(key.Name, key.Name)) + { + err = ClearConfigValue(key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Warning, KVS leakage, failed to remove old KVS value"); + } + } - success = setPref_new(key.Namespace, key.Name, (uint8_t *) &val, sizeof(uint64_t)); - if (!success) + error = setPref_new(key.Namespace, key.Name, (uint8_t *) &val, sizeof(uint64_t)); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "setPref: %s/%s = %d(0x%x) failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), val, val); @@ -240,15 +264,26 @@ CHIP_ERROR AmebaConfig::WriteConfigValue(Key key, uint64_t val) StringOrNullMarker(key.Name), val, val); } - return CHIP_NO_ERROR; + return err; } CHIP_ERROR AmebaConfig::WriteConfigValueStr(Key key, const char * str) { - int32_t success; + CHIP_ERROR err; + int32_t error; + + if (checkExist(key.Name, key.Name)) + { + err = ClearConfigValue(key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Warning, KVS leakage, failed to remove old KVS value"); + } + } - success = setPref_new(key.Namespace, key.Name, (uint8_t *) str, strlen(str) + 1); - if (!success) + error = setPref_new(key.Namespace, key.Name, (uint8_t *) str, strlen(str) + 1); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "setPref: %s/%s = %s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), StringOrNullMarker(str)); @@ -258,7 +293,8 @@ CHIP_ERROR AmebaConfig::WriteConfigValueStr(Key key, const char * str) ChipLogProgress(DeviceLayer, "NVS set: %s/%s = \"%s\"", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name), StringOrNullMarker(str)); } - return CHIP_NO_ERROR; + + return err; } CHIP_ERROR AmebaConfig::WriteConfigValueStr(Key key, const char * str, size_t strLen) @@ -279,10 +315,21 @@ CHIP_ERROR AmebaConfig::WriteConfigValueStr(Key key, const char * str, size_t st CHIP_ERROR AmebaConfig::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) { - int32_t success; + CHIP_ERROR err; + int32_t error; - success = setPref_new(key.Namespace, key.Name, (uint8_t *) data, dataLen); - if (!success) + if (checkExist(key.Name, key.Name)) + { + err = ClearConfigValue(key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Warning, KVS leakage, failed to remove old KVS value"); + } + } + + error = setPref_new(key.Namespace, key.Name, (uint8_t *) data, dataLen); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "setPref: %s/%s failed\n", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); } @@ -292,15 +339,17 @@ CHIP_ERROR AmebaConfig::WriteConfigValueBin(Key key, const uint8_t * data, size_ StringOrNullMarker(key.Name), dataLen); } - return CHIP_NO_ERROR; + return err; } CHIP_ERROR AmebaConfig::ClearConfigValue(Key key) { - int32_t success; + CHIP_ERROR err; + int32_t error; - success = deleteKey(key.Namespace, key.Name); - if (!success) + error = deleteKey(key.Namespace, key.Name); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "%s : %s/%s failed\n", __FUNCTION__, StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); @@ -310,7 +359,7 @@ CHIP_ERROR AmebaConfig::ClearConfigValue(Key key) ChipLogProgress(DeviceLayer, "NVS erase: %s/%s", StringOrNullMarker(key.Namespace), StringOrNullMarker(key.Name)); } - return CHIP_NO_ERROR; + return err; } bool AmebaConfig::ConfigValueExists(Key key) @@ -320,40 +369,50 @@ bool AmebaConfig::ConfigValueExists(Key key) CHIP_ERROR AmebaConfig::InitNamespace() { - int32_t success = -1; + CHIP_ERROR err; + int32_t error; - success = registerPref(); - if (success != 0) + error = registerPref(); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "DCT modules registration failed"); + goto exit; } - success = registerPref2(); - if (success != 0) + error = registerPref2(); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "DCT2 modules registration failed"); } - return CHIP_NO_ERROR; +exit: + return err; } CHIP_ERROR AmebaConfig::ClearNamespace() { - int32_t success = -1; + CHIP_ERROR err; + int32_t error; - success = clearPref(); - if (success != 0) + error = clearPref(); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "DCT modules unregistration failed\n"); + goto exit; } - success = clearPref2(); - if (success != 0) + error = clearPref2(); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "DCT2 modules unregistration failed\n"); } - return CHIP_NO_ERROR; +exit: + return err; } void AmebaConfig::RunConfigUnitTest() {} diff --git a/src/platform/Ameba/AmebaUtils.cpp b/src/platform/Ameba/AmebaUtils.cpp index 578ffab2cd5816..12118dfb14e9f3 100644 --- a/src/platform/Ameba/AmebaUtils.cpp +++ b/src/platform/Ameba/AmebaUtils.cpp @@ -40,10 +40,10 @@ constexpr char kWiFiCredentialsKeyName[] = "wifi-pass"; CHIP_ERROR AmebaUtils::StartWiFi(void) { - CHIP_ERROR err = CHIP_NO_ERROR; // Ensure that the WiFi layer is started. - matter_wifi_on(RTW_MODE_STA); - return err; + int32_t error = matter_wifi_on(RTW_MODE_STA); + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); + return CHIP_NO_ERROR; // will fail if wifi is already initialized, let it pass } CHIP_ERROR AmebaUtils::IsStationEnabled(bool & staEnabled) @@ -60,22 +60,23 @@ bool AmebaUtils::IsStationProvisioned(void) CHIP_ERROR AmebaUtils::IsStationConnected(bool & connected) { - CHIP_ERROR err = CHIP_NO_ERROR; - connected = (matter_wifi_is_connected_to_ap() == RTW_SUCCESS) ? 1 : 0; + int32_t error = matter_wifi_is_connected_to_ap(); + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); + connected = (err == CHIP_NO_ERROR) ? true : false; return err; } CHIP_ERROR AmebaUtils::EnableStationMode(void) { - CHIP_ERROR err = CHIP_NO_ERROR; // Ensure that station mode is enabled in the WiFi layer. - matter_wifi_set_mode(RTW_MODE_STA); + int32_t error = matter_wifi_set_mode(RTW_MODE_STA); + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); return err; } CHIP_ERROR AmebaUtils::SetWiFiConfig(rtw_wifi_config_t * config) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err; // don't store if ssid is null if (config->ssid[0] == 0) { @@ -95,7 +96,7 @@ CHIP_ERROR AmebaUtils::SetWiFiConfig(rtw_wifi_config_t * config) CHIP_ERROR AmebaUtils::GetWiFiConfig(rtw_wifi_config_t * config) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err; size_t ssidLen = 0; size_t credentialsLen = 0; @@ -117,8 +118,8 @@ CHIP_ERROR AmebaUtils::GetWiFiConfig(rtw_wifi_config_t * config) CHIP_ERROR AmebaUtils::ClearWiFiConfig() { /* Clear Wi-Fi Configurations in Storage */ - CHIP_ERROR err = CHIP_NO_ERROR; - err = PersistedStorage::KeyValueStoreMgr().Delete(kWiFiSSIDKeyName); + CHIP_ERROR err; + err = PersistedStorage::KeyValueStoreMgr().Delete(kWiFiSSIDKeyName); SuccessOrExit(err); err = PersistedStorage::KeyValueStoreMgr().Delete(kWiFiCredentialsKeyName); @@ -130,43 +131,46 @@ CHIP_ERROR AmebaUtils::ClearWiFiConfig() CHIP_ERROR AmebaUtils::WiFiDisconnect(void) { - CHIP_ERROR err = CHIP_NO_ERROR; - ChipLogProgress(DeviceLayer, "matter_wifi_disconnect"); - err = (matter_wifi_disconnect() == RTW_SUCCESS) ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; + ChipLogProgress(DeviceLayer, "Disconnecting WiFi"); + int32_t error = matter_wifi_disconnect(); + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); + if (err == CHIP_NO_ERROR) + { + ChipLogProgress(DeviceLayer, "matter_lwip_releaseip"); + matter_lwip_releaseip(); + } return err; } CHIP_ERROR AmebaUtils::WiFiConnectProvisionedNetwork(void) { - CHIP_ERROR err = CHIP_NO_ERROR; rtw_wifi_config_t * config = (rtw_wifi_config_t *) pvPortMalloc(sizeof(rtw_wifi_config_t)); memset(config, 0, sizeof(rtw_wifi_config_t)); GetWiFiConfig(config); ChipLogProgress(DeviceLayer, "Connecting to AP : [%s]", (char *) config->ssid); - int ameba_err = matter_wifi_connect((char *) config->ssid, RTW_SECURITY_WPA_WPA2_MIXED, (char *) config->password, + int32_t error = matter_wifi_connect((char *) config->ssid, RTW_SECURITY_WPA_WPA2_MIXED, (char *) config->password, strlen((const char *) config->ssid), strlen((const char *) config->password), 0, nullptr); + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); vPortFree(config); - err = (ameba_err == RTW_SUCCESS) ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; return err; } CHIP_ERROR AmebaUtils::WiFiConnect(const char * ssid, const char * password) { - CHIP_ERROR err = CHIP_NO_ERROR; ChipLogProgress(DeviceLayer, "Connecting to AP : [%s]", (char *) ssid); - int ameba_err = matter_wifi_connect((char *) ssid, RTW_SECURITY_WPA_WPA2_MIXED, (char *) password, strlen(ssid), + int32_t error = matter_wifi_connect((char *) ssid, RTW_SECURITY_WPA_WPA2_MIXED, (char *) password, strlen(ssid), strlen(password), 0, nullptr); - err = (ameba_err == RTW_SUCCESS) ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); return err; } CHIP_ERROR AmebaUtils::SetCurrentProvisionedNetwork() { - CHIP_ERROR err = CHIP_NO_ERROR; rtw_wifi_setting_t pSetting; - int ret = matter_get_sta_wifi_info(&pSetting); - if (ret < 0) + int32_t error = matter_get_sta_wifi_info(&pSetting); + CHIP_ERROR err = MapError(error, AmebaErrorType::kWiFiError); + if (err != CHIP_NO_ERROR) { ChipLogProgress(DeviceLayer, "STA No Wi-Fi Info"); goto exit; @@ -197,3 +201,52 @@ CHIP_ERROR AmebaUtils::SetCurrentProvisionedNetwork() exit: return err; } + +CHIP_ERROR AmebaUtils::MapError(int32_t error, AmebaErrorType type) +{ + if (type == AmebaErrorType::kDctError) + { + return MapDctError(error); + } + if (type == AmebaErrorType::kFlashError) + { + return MapFlashError(error); + } + if (type == AmebaErrorType::kWiFiError) + { + return MapWiFiError(error); + } + return CHIP_ERROR_INTERNAL; +} + +CHIP_ERROR AmebaUtils::MapDctError(int32_t error) +{ + if (error == DCT_SUCCESS) + return CHIP_NO_ERROR; + if (error == DCT_ERR_NO_MEMORY) + return CHIP_ERROR_NO_MEMORY; + if (error == DCT_ERR_NOT_FIND) + return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + if (error == DCT_ERR_SIZE_OVER) + return CHIP_ERROR_INVALID_ARGUMENT; + if (error == DCT_ERR_MODULE_BUSY) + return CHIP_ERROR_BUSY; + + return CHIP_ERROR_INTERNAL; +} + +CHIP_ERROR AmebaUtils::MapFlashError(int32_t error) +{ + if (error == 1) + return CHIP_NO_ERROR; + + return CHIP_ERROR_INTERNAL; +} + +CHIP_ERROR AmebaUtils::MapWiFiError(int32_t error) +{ + if (error == RTW_SUCCESS) + return CHIP_NO_ERROR; + + return CHIP_ERROR_INTERNAL; +} diff --git a/src/platform/Ameba/AmebaUtils.h b/src/platform/Ameba/AmebaUtils.h index 5fcc5c9c2ef487..c1fa81b163580e 100644 --- a/src/platform/Ameba/AmebaUtils.h +++ b/src/platform/Ameba/AmebaUtils.h @@ -24,6 +24,13 @@ namespace chip { namespace DeviceLayer { namespace Internal { +enum class AmebaErrorType +{ + kDctError, + kFlashError, + kWiFiError, +}; + class AmebaUtils { public: @@ -39,6 +46,14 @@ class AmebaUtils static CHIP_ERROR WiFiConnectProvisionedNetwork(void); static CHIP_ERROR WiFiConnect(const char * ssid, const char * password); static CHIP_ERROR SetCurrentProvisionedNetwork(void); + static CHIP_ERROR WiFiConnect(void); + + static CHIP_ERROR MapError(int32_t error, AmebaErrorType type); + +private: + static CHIP_ERROR MapDctError(int32_t error); + static CHIP_ERROR MapFlashError(int32_t error); + static CHIP_ERROR MapWiFiError(int32_t error); }; } // namespace Internal diff --git a/src/platform/Ameba/ConfigurationManagerImpl.cpp b/src/platform/Ameba/ConfigurationManagerImpl.cpp index 16d7a8f45e75f7..b3c6cbfbb66db6 100644 --- a/src/platform/Ameba/ConfigurationManagerImpl.cpp +++ b/src/platform/Ameba/ConfigurationManagerImpl.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -152,13 +153,22 @@ CHIP_ERROR ConfigurationManagerImpl::GetLocationCapability(uint8_t & location) CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) { + CHIP_ERROR err; + int32_t error; + char temp[32]; uint32_t mac[ETH_ALEN]; - int i = 0; + char * token = strtok(temp, ":"); + int i = 0; - wifi_get_mac_address(temp); + error = matter_wifi_get_mac_address(temp); + err = AmebaUtils::MapError(error, AmebaErrorType::kWiFiError); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to get mac address"); + goto exit; + } - char * token = strtok(temp, ":"); while (token != NULL) { mac[i] = (uint32_t) strtol(token, NULL, 16); @@ -169,7 +179,8 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) for (i = 0; i < ETH_ALEN; i++) buf[i] = mac[i] & 0xFF; - return CHIP_NO_ERROR; +exit: + return err; } bool ConfigurationManagerImpl::CanFactoryReset() @@ -188,10 +199,6 @@ CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform: AmebaConfig::Key configKey{ AmebaConfig::kConfigNamespace_ChipCounters, key }; CHIP_ERROR err = ReadConfigValue(configKey, value); - if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) - { - err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; - } return err; } diff --git a/src/platform/Ameba/ConnectivityManagerImpl.cpp b/src/platform/Ameba/ConnectivityManagerImpl.cpp index ba289b115c0bab..d42886b0f75ac3 100644 --- a/src/platform/Ameba/ConnectivityManagerImpl.cpp +++ b/src/platform/Ameba/ConnectivityManagerImpl.cpp @@ -524,7 +524,7 @@ void ConnectivityManagerImpl::DriveStationState() { WiFiStationState prevState = mWiFiStationState; ChangeWiFiStationState(kWiFiStationState_NotConnected); - if (prevState != kWiFiStationState_Connecting_Failed) + if (prevState == kWiFiStationState_Connecting_Failed) { ChipLogProgress(DeviceLayer, "WiFi station failed to connect"); // TODO: check retry count if exceeded, then clearwificonfig @@ -858,13 +858,13 @@ void ConnectivityManagerImpl::RtkWiFiScanCompletedHandler(void) void ConnectivityManagerImpl::DHCPProcessThread(void * param) { - matter_lwip_dhcp(0, DHCP_START); + matter_lwip_dhcp(); PlatformMgr().LockChipStack(); sInstance.OnStationIPv4AddressAvailable(); PlatformMgr().UnlockChipStack(); #if LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 #if LWIP_IPV6 - matter_lwip_dhcp(0, DHCP6_START); + matter_lwip_dhcp6(); PlatformMgr().LockChipStack(); sInstance.OnIPv6AddressAvailable(); PlatformMgr().UnlockChipStack(); diff --git a/src/platform/Ameba/DiagnosticDataProviderImpl.cpp b/src/platform/Ameba/DiagnosticDataProviderImpl.cpp index b9f2f018e6987d..ab1f2438639675 100644 --- a/src/platform/Ameba/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Ameba/DiagnosticDataProviderImpl.cpp @@ -25,10 +25,13 @@ #include #include +#include #include #include +using namespace chip::DeviceLayer::Internal; + namespace chip { namespace DeviceLayer { @@ -248,19 +251,25 @@ void DiagnosticDataProviderImpl::ReleaseNetworkInterfaces(NetworkInterface * net #if CHIP_DEVICE_CONFIG_ENABLE_WIFI CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(MutableByteSpan & BssId) { + CHIP_ERROR err; + int32_t error; + constexpr size_t bssIdSize = 6; VerifyOrReturnError(BssId.size() >= bssIdSize, CHIP_ERROR_BUFFER_TOO_SMALL); - if (wifi_get_ap_bssid(BssId.data()) != 0) + error = matter_wifi_get_ap_bssid(BssId.data()); + err = AmebaUtils::MapError(error, AmebaErrorType::kWiFiError); + + if (err != CHIP_NO_ERROR) { - return CHIP_ERROR_READ_FAILED; + return err; } BssId.reduce_size(bssIdSize); ChipLogProgress(DeviceLayer, "%02x,%02x,%02x,%02x,%02x,%02x\n", BssId.data()[0], BssId.data()[1], BssId.data()[2], BssId.data()[3], BssId.data()[4], BssId.data()[5]); - return CHIP_NO_ERROR; + return err; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetworkDiagnostics::WiFiVersionEnum & wifiVersion) @@ -273,20 +282,25 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetwork CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) { + CHIP_ERROR err; + int32_t error; + using app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum; unsigned int _auth_type; - unsigned short _security = 0; + unsigned short security = 0; rtw_wifi_setting_t setting; -#ifdef CONFIG_PLATFORM_8721D - if (wext_get_enc_ext("wlan0", &_security, &setting.key_idx, setting.password) < 0) + error = matter_wifi_get_security_type("wlan0", &security, &setting.key_idx, setting.password); + err = AmebaUtils::MapError(error, AmebaErrorType::kWiFiError); + if (err != CHIP_NO_ERROR) { securityType = SecurityTypeEnum::kUnspecified; } +#ifdef CONFIG_PLATFORM_8721D else { - switch (_security) + switch (security) { case IW_ENCODE_ALG_NONE: securityType = SecurityTypeEnum::kNone; @@ -306,14 +320,9 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNe } } #else - wext_get_enc_ext("wlan0", &_security, &setting.key_idx, setting.password); - if (wext_get_auth_type("wlan0", &_auth_type) < 0) - { - securityType = SecurityTypeEnum::kUnspecified; - } else { - switch (_security) + switch (security) { case IW_ENCODE_ALG_NONE: securityType = SecurityTypeEnum::kNone; @@ -342,30 +351,40 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNe } #endif - return CHIP_NO_ERROR; + return err; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNumber) { + CHIP_ERROR err; + int32_t error; unsigned char channel; - if (wext_get_channel("wlan0", &channel) < 0) + error = matter_wifi_get_wifi_channel_number("wlan0", &channel); + err = AmebaUtils::MapError(error, AmebaErrorType::kWiFiError); + if (err != CHIP_NO_ERROR) channelNumber = 0; else channelNumber = (uint16_t) channel; - return CHIP_NO_ERROR; + return err; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi) { - int _rssi = 0; - if (wifi_get_rssi(&_rssi) < 0) + CHIP_ERROR err; + int32_t error; + + error = matter_wifi_get_rssi((int *) &rssi); + err = AmebaUtils::MapError(error, AmebaErrorType::kWiFiError); + + if (err != CHIP_NO_ERROR) + { + // set rssi to 0 upon error rssi = 0; - else - rssi = _rssi; + } - return CHIP_NO_ERROR; + return err; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconLostCount(uint32_t & beaconLostCount) diff --git a/src/platform/Ameba/FactoryDataDecoder.cpp b/src/platform/Ameba/FactoryDataDecoder.cpp index 3c6874b5207863..4e3536e3de1455 100644 --- a/src/platform/Ameba/FactoryDataDecoder.cpp +++ b/src/platform/Ameba/FactoryDataDecoder.cpp @@ -17,29 +17,28 @@ #include "FactoryDataDecoder.h" #include "chip_porting.h" +#include #include +using namespace chip::DeviceLayer::Internal; + namespace chip { namespace DeviceLayer { CHIP_ERROR FactoryDataDecoder::ReadFactoryData(uint8_t * buffer, uint16_t * pfactorydata_len) { - uint32_t ret = 0; - ret = ReadFactory(buffer, pfactorydata_len); - if (ret != 1) - return CHIP_ERROR_INTERNAL; + int32_t error = ReadFactory(buffer, pfactorydata_len); + CHIP_ERROR err = AmebaUtils::MapError(error, AmebaErrorType::kFlashError); - return CHIP_NO_ERROR; + return err; } CHIP_ERROR FactoryDataDecoder::DecodeFactoryData(uint8_t * buffer, FactoryData * fdata, uint16_t factorydata_len) { - uint32_t ret = 0; - ret = DecodeFactory(buffer, fdata, factorydata_len); - if (ret != 0) - return CHIP_ERROR_INTERNAL; + int32_t error = DecodeFactory(buffer, fdata, factorydata_len); + CHIP_ERROR err = AmebaUtils::MapError(error, AmebaErrorType::kFlashError); - return CHIP_NO_ERROR; + return err; } } // namespace DeviceLayer diff --git a/src/platform/Ameba/KeyValueStoreManagerImpl.cpp b/src/platform/Ameba/KeyValueStoreManagerImpl.cpp index 1fede31febb7c1..282d58c47c1f65 100644 --- a/src/platform/Ameba/KeyValueStoreManagerImpl.cpp +++ b/src/platform/Ameba/KeyValueStoreManagerImpl.cpp @@ -23,9 +23,12 @@ /* this file behaves like a config.h, comes first */ #include "FreeRTOS.h" #include "chip_porting.h" +#include #include #include +using namespace chip::DeviceLayer::Internal; + namespace chip { namespace DeviceLayer { namespace PersistedStorage { @@ -35,99 +38,79 @@ KeyValueStoreManagerImpl KeyValueStoreManagerImpl::sInstance; CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, size_t offset_bytes) { - CHIP_ERROR err = CHIP_NO_ERROR; - int32_t ret = -1; + CHIP_ERROR err; + int32_t error; if (!value) { - return (err = CHIP_ERROR_INVALID_ARGUMENT); + err = CHIP_ERROR_INVALID_ARGUMENT; + goto exit; } if (offset_bytes > 0) { // Offset and partial reads are not supported in nvs, for now just return NOT_IMPLEMENTED. Support can be added in the // future if this is needed. - return (err = CHIP_ERROR_NOT_IMPLEMENTED); + err = CHIP_ERROR_NOT_IMPLEMENTED; + goto exit; } if (read_bytes_size) { - ret = getPref_bin_new(key, key, (uint8_t *) value, value_size, read_bytes_size); + error = getPref_bin_new(key, key, (uint8_t *) value, value_size, read_bytes_size); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); } else { size_t * dummy_read_bytes_size = (size_t *) pvPortMalloc(sizeof(size_t)); if (!dummy_read_bytes_size) { - return CHIP_ERROR_INTERNAL; + err = CHIP_ERROR_INTERNAL; + goto exit; } - ret = getPref_bin_new(key, key, (uint8_t *) value, value_size, dummy_read_bytes_size); + error = getPref_bin_new(key, key, (uint8_t *) value, value_size, dummy_read_bytes_size); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); vPortFree(dummy_read_bytes_size); } - switch (ret) - { - case 0: - return CHIP_NO_ERROR; - case -6: - return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; - case -7: - return CHIP_ERROR_INVALID_ARGUMENT; - case -8: - return CHIP_ERROR_BUFFER_TOO_SMALL; - default: - break; - } - return CHIP_ERROR_INTERNAL; +exit: + return err; } CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) { - CHIP_ERROR err = CHIP_NO_ERROR; - int32_t ret = -1; + CHIP_ERROR err; + int32_t error; if (!value) { - return (err = CHIP_ERROR_INVALID_ARGUMENT); + err = CHIP_ERROR_INVALID_ARGUMENT; + goto exit; } if (checkExist(key, key)) { - ret = deleteKey(key, key); - if (ret != 0) + error = deleteKey(key, key); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); + if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "Warning, KVS leakage, failed to remove old kvs value"); } } - ret = setPref_new(key, key, (uint8_t *) value, value_size); - - if (TRUE == ret) - err = CHIP_NO_ERROR; - else - err = CHIP_ERROR_INTERNAL; + error = setPref_new(key, key, (uint8_t *) value, value_size); + err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); +exit: return err; } CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) { - int32_t ret = deleteKey(key, key); - switch (ret) - { - case 0: - return CHIP_NO_ERROR; - case -6: - return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; - case -7: - return CHIP_ERROR_INVALID_ARGUMENT; - case -8: - return CHIP_ERROR_BUFFER_TOO_SMALL; - default: - break; - } + int32_t error = deleteKey(key, key); + CHIP_ERROR err = AmebaUtils::MapError(error, AmebaErrorType::kDctError); - return CHIP_ERROR_INTERNAL; + return err; } } // namespace PersistedStorage diff --git a/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp b/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp index 38be3f2080f0b5..914e4f337f6688 100644 --- a/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/Ameba/NetworkCommissioningWiFiDriver.cpp @@ -127,10 +127,13 @@ Status AmebaWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, Mutabl CHIP_ERROR AmebaWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen) { CHIP_ERROR err = CHIP_NO_ERROR; + bool connected; + // If device is already connected to WiFi, then disconnect the WiFi, - // clear the WiFi configurations and add the newly provided WiFi configurations. - if (chip::DeviceLayer::Internal::AmebaUtils::IsStationProvisioned()) + chip::DeviceLayer::Internal::AmebaUtils::IsStationConnected(connected); + if (connected) { + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Disconnecting); ChipLogProgress(DeviceLayer, "Disconnecting WiFi station interface"); err = chip::DeviceLayer::Internal::AmebaUtils::WiFiDisconnect(); if (err != CHIP_NO_ERROR) @@ -138,6 +141,11 @@ CHIP_ERROR AmebaWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLe ChipLogError(DeviceLayer, "WiFiDisconnect() failed"); return err; } + } + + // clear the WiFi configurations and add the newly provided WiFi configurations. + if (chip::DeviceLayer::Internal::AmebaUtils::IsStationProvisioned()) + { err = chip::DeviceLayer::Internal::AmebaUtils::ClearWiFiConfig(); if (err != CHIP_NO_ERROR) { @@ -146,9 +154,12 @@ CHIP_ERROR AmebaWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLe } } - ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting); + DeviceLayer::ConnectivityManager::WiFiStationState state = DeviceLayer::ConnectivityManager::kWiFiStationState_Connecting; + DeviceLayer::SystemLayer().ScheduleLambda([state, ssid, key]() { + ConnectivityMgrImpl().ChangeWiFiStationState(state); + chip::DeviceLayer::Internal::AmebaUtils::WiFiConnect(ssid, key); + }); - err = chip::DeviceLayer::Internal::AmebaUtils::WiFiConnect(ssid, key); return err; } @@ -304,7 +315,7 @@ void AmebaWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * cal CHIP_ERROR AmebaWiFiDriver::SetLastDisconnectReason(const ChipDeviceEvent * event) { VerifyOrReturnError(event->Type == DeviceEventType::kRtkWiFiStationDisconnectedEvent, CHIP_ERROR_INVALID_ARGUMENT); - mLastDisconnectedReason = wifi_get_last_error(); // TODO: change this to wrapper + mLastDisconnectedReason = matter_wifi_get_last_error(); return CHIP_NO_ERROR; } diff --git a/src/platform/Ameba/PlatformManagerImpl.cpp b/src/platform/Ameba/PlatformManagerImpl.cpp index 0b89c4a8c24971..33ad2a657f3e10 100644 --- a/src/platform/Ameba/PlatformManagerImpl.cpp +++ b/src/platform/Ameba/PlatformManagerImpl.cpp @@ -39,7 +39,7 @@ CHIP_ERROR InitLwIPCoreLock(void); PlatformManagerImpl PlatformManagerImpl::sInstance; extern "C" { -extern int rtw_get_random_bytes(void * dst, size_t size); +extern int rtw_get_random_bytes(void * dst, uint32_t size); } static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) { diff --git a/src/platform/Ameba/SystemTimeSupport.cpp b/src/platform/Ameba/SystemTimeSupport.cpp index 57e5d863b059f9..5b7d03b212d672 100644 --- a/src/platform/Ameba/SystemTimeSupport.cpp +++ b/src/platform/Ameba/SystemTimeSupport.cpp @@ -28,14 +28,10 @@ #include #include -#include "rtc_api.h" #include "task.h" +#include #include -extern void rtc_init(void); -extern time_t rtc_read(void); -extern void rtc_write(time_t t); - struct rtkTimeVal { uint32_t tv_sec; /* seconds */ @@ -69,7 +65,7 @@ CHIP_ERROR ClockImpl::GetClock_RealTime(Clock::Microseconds64 & curTime) time_t seconds; struct rtkTimeVal tv; - seconds = rtc_read(); + seconds = matter_rtc_read(); tv.tv_sec = (uint32_t) seconds; tv.tv_usec = 0; @@ -98,8 +94,8 @@ CHIP_ERROR ClockImpl::SetClock_RealTime(Microseconds64 aNewCurTime) struct rtkTimeVal tv; tv.tv_sec = static_cast(aNewCurTime.count() / UINT64_C(1000000)); tv.tv_usec = static_cast(aNewCurTime.count() % UINT64_C(1000000)); - rtc_init(); - rtc_write(tv.tv_sec); + matter_rtc_init(); + matter_rtc_write(tv.tv_sec); return CHIP_NO_ERROR; } From 3633de9e575eba52e9943a382af757f5cc769457 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 15 Jun 2023 15:00:40 +0200 Subject: [PATCH 10/31] Account for the retry delay booster in unit test (#27256) * Fix compilation warnings when RMP_TICKLESS_DEBUG is defined * Account for the retry delay booster in unit test --- src/messaging/ReliableMessageMgr.cpp | 26 +++++++------- .../tests/TestAbortExchangesForFabric.cpp | 36 +++++++++---------- 2 files changed, 28 insertions(+), 34 deletions(-) diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 2a71463154ebd7..5c0989c74a1540 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -77,10 +77,10 @@ void ReliableMessageMgr::Shutdown() mSystemLayer = nullptr; } -#if defined(RMP_TICKLESS_DEBUG) void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) { - ChipLogDetail(ExchangeManager, log); +#if defined(RMP_TICKLESS_DEBUG) + ChipLogDetail(ExchangeManager, "%s", log); mRetransTable.ForEachActiveObject([&](auto * entry) { ChipLogDetail(ExchangeManager, @@ -89,17 +89,15 @@ void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) entry->nextRetransTime.count()); return Loop::Continue; }); +#endif } -#else -void ReliableMessageMgr::TicklessDebugDumpRetransTable(const char * log) {} -#endif // RMP_TICKLESS_DEBUG void ReliableMessageMgr::ExecuteActions() { System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); #if defined(RMP_TICKLESS_DEBUG) - ChipLogDetail(ExchangeManager, "ReliableMessageMgr::ExecuteActions at % " PRIu64 "ms", now.count()); + ChipLogDetail(ExchangeManager, "ReliableMessageMgr::ExecuteActions at %" PRIu64 "ms", now.count()); #endif ExecuteForAllContext([&](ReliableMessageContext * rc) { @@ -180,7 +178,7 @@ void ReliableMessageMgr::Timeout(System::Layer * aSystemLayer, void * aAppState) VerifyOrDie((aSystemLayer != nullptr) && (manager != nullptr)); #if defined(RMP_TICKLESS_DEBUG) - ChipLogDetail(ExchangeManager, "ReliableMessageMgr::Timeout\n"); + ChipLogDetail(ExchangeManager, "ReliableMessageMgr::Timeout"); #endif // Execute any actions that are due this tick @@ -392,16 +390,17 @@ void ReliableMessageMgr::StartTimer() return Loop::Continue; }); + StopTimer(); + if (nextWakeTime != System::Clock::Timestamp::max()) { -#if defined(RMP_TICKLESS_DEBUG) - ChipLogDetail(ExchangeManager, "ReliableMessageMgr::StartTimer wake at %" PRIu64 "ms", nextWakeTime); -#endif - - StopTimer(); - const System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); const auto nextWakeDelay = (nextWakeTime > now) ? nextWakeTime - now : 0_ms; + +#if defined(RMP_TICKLESS_DEBUG) + ChipLogDetail(ExchangeManager, "ReliableMessageMgr::StartTimer at %" PRIu64 "ms wake at %" PRIu64 "ms (in %" PRIu64 "ms)", + now.count(), nextWakeTime.count(), nextWakeDelay.count()); +#endif VerifyOrDie(mSystemLayer->StartTimer(nextWakeDelay, Timeout, this) == CHIP_NO_ERROR); } else @@ -409,7 +408,6 @@ void ReliableMessageMgr::StartTimer() #if defined(RMP_TICKLESS_DEBUG) ChipLogDetail(ExchangeManager, "ReliableMessageMgr skipped timer"); #endif - StopTimer(); } TicklessDebugDumpRetransTable("ReliableMessageMgr::StartTimer Dumping mRetransTable entries after setting wakeup times"); diff --git a/src/messaging/tests/TestAbortExchangesForFabric.cpp b/src/messaging/tests/TestAbortExchangesForFabric.cpp index a3d9e8a09fcdd1..ef9ff8ca8039b7 100644 --- a/src/messaging/tests/TestAbortExchangesForFabric.cpp +++ b/src/messaging/tests/TestAbortExchangesForFabric.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ namespace { using namespace chip; using namespace chip::Messaging; using namespace chip::System; +using namespace chip::System::Clock::Literals; using namespace chip::Protocols; using TestContext = Test::LoopbackMessagingContext; @@ -203,7 +205,13 @@ void CommonCheckAbortAllButOneExchange(nlTestSuite * inSuite, TestContext & ctx, // We've set the session into responsive mode by altering the MRP intervals, so we should be able to // trigger a MRP failure due to timing out waiting for an ACK. // - ctx.GetIOContext().DriveIOUntil(System::Clock::Milliseconds32(1000), [&]() { return false; }); + auto waitTimeout = System::Clock::Milliseconds32(1000); +#ifdef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST + // Account for the retry delay booster, so that we do not timeout our IO processing before the + // retransmission failure is triggered. + waitTimeout += CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS * CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST; +#endif + ctx.GetIOContext().DriveIOUntil(waitTimeout, [&]() { return false; }); } else { @@ -235,32 +243,20 @@ void CheckAbortAllButOneExchangeResponseTimeout(nlTestSuite * inSuite, void * in CommonCheckAbortAllButOneExchange(inSuite, ctx, true); } -// Test Suite - -/** - * Test Suite that lists all the test functions. - */ -// clang-format off -const nlTest sTests[] = -{ - NL_TEST_DEF("Test aborting all but one exchange", CheckAbortAllButOneExchange), - NL_TEST_DEF("Test aborting all but one exchange + response timeout", CheckAbortAllButOneExchangeResponseTimeout), - - NL_TEST_SENTINEL() +const nlTest sTests[] = { + NL_TEST_DEF("Test aborting all but one exchange", CheckAbortAllButOneExchange), + NL_TEST_DEF("Test aborting all but one exchange + response timeout", CheckAbortAllButOneExchangeResponseTimeout), + NL_TEST_SENTINEL(), }; -// clang-format on -// clang-format off -nlTestSuite sSuite = -{ +nlTestSuite sSuite = { "Test-AbortExchangesForFabric", &sTests[0], TestContext::Initialize, - TestContext::Finalize + TestContext::Finalize, }; -// clang-format on -} // anonymous namespace +} // namespace /** * Main From 3bacb57cd4a93a4fd3f695002fdd7d1a185a1568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:01:58 +0200 Subject: [PATCH 11/31] Optimize compilation time (#27228) * Optimize compilation time 1. Do not to include cluster-objects.h if not needed as parsing such a large header significantly impacts the build time and in most cases it is enough to include ClusterEnums.h. 2. Do not build the controller library for embedded targets, by default. If needed, this can be overriden using the chip_build_controller argument from lib.gni. * Fix build --- .../all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp | 1 + examples/bridge-app/asr/subdevice/SubDeviceManager.cpp | 1 + examples/bridge-app/asr/subdevice/subdevice_test.cpp | 1 + .../nxp/k32w/k32w0/main/ZclCallbacks.cpp | 1 + examples/platform/silabs/efr32/BUILD.gn | 1 + .../App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h | 2 ++ .../tv-casting-common/include/ApplicationBasic.h | 2 ++ .../tv-casting-common/include/ApplicationLauncher.h | 2 ++ .../tv-casting-app/tv-casting-common/include/Channel.h | 2 ++ .../tv-casting-common/include/ContentLauncher.h | 2 ++ .../tv-casting-app/tv-casting-common/include/KeypadInput.h | 2 ++ .../tv-casting-common/include/LevelControl.h | 2 ++ .../tv-casting-common/include/MediaPlayback.h | 2 ++ examples/tv-casting-app/tv-casting-common/include/OnOff.h | 2 ++ .../tv-casting-common/include/TargetNavigator.h | 2 ++ .../tv-casting-common/include/TargetVideoPlayerInfo.h | 2 ++ src/app/chip_data_model.cmake | 6 ++++-- src/app/server/CommissioningWindowManager.h | 2 +- src/app/util/generic-callbacks.h | 1 - src/controller/CommissioningDelegate.h | 1 + src/credentials/GroupDataProvider.h | 2 +- src/include/platform/AttributeList.h | 2 +- src/include/platform/ConfigurationManager.h | 2 +- src/include/platform/ConnectivityManager.h | 1 - src/include/platform/ThreadStackManager.h | 1 - src/lib/BUILD.gn | 7 ++++++- src/lib/lib.gni | 6 ++++++ src/platform/Linux/ThreadStackManagerImpl.cpp | 2 ++ src/platform/webos/ThreadStackManagerImpl.cpp | 2 ++ src/protocols/secure_channel/CASEDestinationId.cpp | 1 + 30 files changed, 53 insertions(+), 10 deletions(-) diff --git a/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp index 104b3f52a46364..269d1a8c7623a2 100644 --- a/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp +++ b/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp @@ -25,6 +25,7 @@ #include "DeviceCallbacks.h" #include "CHIPDeviceManager.h" +#include #include #include #include diff --git a/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp b/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp index 6e15406c9ff4fa..ca044c2a822aff 100644 --- a/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp +++ b/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp @@ -18,6 +18,7 @@ #include "SubDeviceManager.h" #include "SubDevice.h" +#include #include #include #include diff --git a/examples/bridge-app/asr/subdevice/subdevice_test.cpp b/examples/bridge-app/asr/subdevice/subdevice_test.cpp index f4998294043925..652f361db682a9 100644 --- a/examples/bridge-app/asr/subdevice/subdevice_test.cpp +++ b/examples/bridge-app/asr/subdevice/subdevice_test.cpp @@ -20,6 +20,7 @@ #include "SubDeviceManager.h" #include #include +#include #include #include #include diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp index 4664a02404fabb..fafcb37290aab8 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp @@ -21,6 +21,7 @@ #include "AppTask.h" #include "ContactSensorManager.h" +#include #include #include #include diff --git a/examples/platform/silabs/efr32/BUILD.gn b/examples/platform/silabs/efr32/BUILD.gn index 5a7e50056e8a86..860800e7fb8d68 100644 --- a/examples/platform/silabs/efr32/BUILD.gn +++ b/examples/platform/silabs/efr32/BUILD.gn @@ -357,6 +357,7 @@ source_set("efr32-common") { public_deps += [ "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/app/server", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", ] diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h index 346043c837dcde..749f5e873ee074 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.h @@ -28,6 +28,8 @@ #include #include +#include + class CallbackBaseJNI { public: diff --git a/examples/tv-casting-app/tv-casting-common/include/ApplicationBasic.h b/examples/tv-casting-app/tv-casting-common/include/ApplicationBasic.h index 4bfa028a129e4b..56cbd6831bdb71 100644 --- a/examples/tv-casting-app/tv-casting-common/include/ApplicationBasic.h +++ b/examples/tv-casting-app/tv-casting-common/include/ApplicationBasic.h @@ -21,6 +21,8 @@ #include +#include + // SUBSCRIBER CLASSES class VendorNameSubscriber : public MediaSubscriptionBase { diff --git a/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h b/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h index 9e8c08b284cd42..3e7f3143a0c0a4 100644 --- a/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h +++ b/examples/tv-casting-app/tv-casting-common/include/ApplicationLauncher.h @@ -22,6 +22,8 @@ #include #include +#include + // COMMAND CLASSES class LaunchAppCommand : public MediaCommandBase #include +#include + // COMMAND CLASSES class ChangeChannelCommand : public MediaCommandBase diff --git a/examples/tv-casting-app/tv-casting-common/include/ContentLauncher.h b/examples/tv-casting-app/tv-casting-common/include/ContentLauncher.h index e859188b4bf726..a5cdcf93a80bcc 100644 --- a/examples/tv-casting-app/tv-casting-common/include/ContentLauncher.h +++ b/examples/tv-casting-app/tv-casting-common/include/ContentLauncher.h @@ -22,6 +22,8 @@ #include #include +#include + // COMMAND CLASSES class LaunchURLCommand : public MediaCommandBase diff --git a/examples/tv-casting-app/tv-casting-common/include/KeypadInput.h b/examples/tv-casting-app/tv-casting-common/include/KeypadInput.h index 5a377e1dff5f46..a4e7a43338e9d6 100644 --- a/examples/tv-casting-app/tv-casting-common/include/KeypadInput.h +++ b/examples/tv-casting-app/tv-casting-common/include/KeypadInput.h @@ -21,6 +21,8 @@ #include #include +#include + class SendKeyCommand : public MediaCommandBase { diff --git a/examples/tv-casting-app/tv-casting-common/include/LevelControl.h b/examples/tv-casting-app/tv-casting-common/include/LevelControl.h index 23c3eb5fbe1238..1f2271f5af1b22 100644 --- a/examples/tv-casting-app/tv-casting-common/include/LevelControl.h +++ b/examples/tv-casting-app/tv-casting-common/include/LevelControl.h @@ -22,6 +22,8 @@ #include #include +#include + // COMMAND CLASSES class StepCommand : public MediaCommandBase diff --git a/examples/tv-casting-app/tv-casting-common/include/MediaPlayback.h b/examples/tv-casting-app/tv-casting-common/include/MediaPlayback.h index 60eb33cb4179d9..ddd510dd0e6801 100644 --- a/examples/tv-casting-app/tv-casting-common/include/MediaPlayback.h +++ b/examples/tv-casting-app/tv-casting-common/include/MediaPlayback.h @@ -22,6 +22,8 @@ #include #include +#include + // COMMAND CLASSES class PlayCommand : public MediaCommandBase diff --git a/examples/tv-casting-app/tv-casting-common/include/OnOff.h b/examples/tv-casting-app/tv-casting-common/include/OnOff.h index 7c4f4d3b2d3273..3c7e003c79970f 100644 --- a/examples/tv-casting-app/tv-casting-common/include/OnOff.h +++ b/examples/tv-casting-app/tv-casting-common/include/OnOff.h @@ -22,6 +22,8 @@ #include #include +#include + // COMMAND CLASSES class OnCommand : public MediaCommandBase { diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetNavigator.h b/examples/tv-casting-app/tv-casting-common/include/TargetNavigator.h index 419375cdc51fec..061de12ba4dad8 100644 --- a/examples/tv-casting-app/tv-casting-common/include/TargetNavigator.h +++ b/examples/tv-casting-app/tv-casting-common/include/TargetNavigator.h @@ -22,6 +22,8 @@ #include #include +#include + // COMMAND CLASSES class NavigateTargetCommand : public MediaCommandBase #include +#include + constexpr size_t kMaxNumberOfEndpoints = 5; class TargetVideoPlayerInfo; diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index 2b61dded83b576..73e49b01f61830 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -75,11 +75,13 @@ function(chip_configure_data_model APP_TARGET) if (ARG_INCLUDE_SERVER) target_sources(${APP_TARGET} ${SCOPE} - ${CHIP_APP_BASE_DIR}/server/EchoHandler.cpp + ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp + ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp + ${CHIP_APP_BASE_DIR}/server/CommissioningWindowManager.cpp ${CHIP_APP_BASE_DIR}/server/Dnssd.cpp + ${CHIP_APP_BASE_DIR}/server/EchoHandler.cpp ${CHIP_APP_BASE_DIR}/server/OnboardingCodesUtil.cpp ${CHIP_APP_BASE_DIR}/server/Server.cpp - ${CHIP_APP_BASE_DIR}/server/CommissioningWindowManager.cpp ) target_compile_options(${APP_TARGET} ${SCOPE} diff --git a/src/app/server/CommissioningWindowManager.h b/src/app/server/CommissioningWindowManager.h index 070a86a66816a1..1fabd26bd6827d 100644 --- a/src/app/server/CommissioningWindowManager.h +++ b/src/app/server/CommissioningWindowManager.h @@ -17,11 +17,11 @@ #pragma once -#include #include #include #include #include +#include #include #include #include diff --git a/src/app/util/generic-callbacks.h b/src/app/util/generic-callbacks.h index 036241acfa2c41..4b46c64511a24a 100644 --- a/src/app/util/generic-callbacks.h +++ b/src/app/util/generic-callbacks.h @@ -17,7 +17,6 @@ #pragma once -#include #include #include #include diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index 72a34e0b5138c9..e1c3f7266dbb5d 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -17,6 +17,7 @@ */ #pragma once +#include #include #include #include diff --git a/src/credentials/GroupDataProvider.h b/src/credentials/GroupDataProvider.h index ca599296f6a659..7d0665ce2fd6ce 100644 --- a/src/credentials/GroupDataProvider.h +++ b/src/credentials/GroupDataProvider.h @@ -20,10 +20,10 @@ #include #include -#include #include #include #include +#include #include #include diff --git a/src/include/platform/AttributeList.h b/src/include/platform/AttributeList.h index 07f9550c8aedca..f974887d2b8a9c 100644 --- a/src/include/platform/AttributeList.h +++ b/src/include/platform/AttributeList.h @@ -22,8 +22,8 @@ #pragma once -#include #include +#include namespace chip { namespace DeviceLayer { diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index a7decf94224786..c9174d97f854c1 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -31,7 +31,7 @@ #include #endif -#include +#include #include #include #include diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index a59217a69a3b8d..fa104a68e0f6b3 100755 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -31,7 +31,6 @@ #include #include -#include #include #if INET_CONFIG_ENABLE_TCP_ENDPOINT diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index 137ac5d0d59814..b3fc19dc5454e3 100755 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -23,7 +23,6 @@ #pragma once -#include #include #include #include diff --git a/src/lib/BUILD.gn b/src/lib/BUILD.gn index e7fdd0a0717165..1e04c837749840 100644 --- a/src/lib/BUILD.gn +++ b/src/lib/BUILD.gn @@ -19,7 +19,6 @@ static_library("lib") { public_deps = [ "${chip_root}/src/app", "${chip_root}/src/ble", - "${chip_root}/src/controller", "${chip_root}/src/crypto", "${chip_root}/src/inet", "${chip_root}/src/lib/asn1", @@ -28,11 +27,17 @@ static_library("lib") { "${chip_root}/src/lib/support", "${chip_root}/src/messaging", "${chip_root}/src/platform", + "${chip_root}/src/protocols", "${chip_root}/src/setup_payload", "${chip_root}/src/system", "${chip_root}/src/transport", ] + # See src/lib/lib.gni for declaration of this build arg. + if (chip_build_controller) { + public_deps += [ "${chip_root}/src/controller" ] + } + # Only include the shell if it is being used. The shell is # a debug feature mostly useful for embedded examples. # See src/lib/lib.gni for declaration of this build arg. diff --git a/src/lib/lib.gni b/src/lib/lib.gni index 213592c274939f..bad9c3724512a7 100644 --- a/src/lib/lib.gni +++ b/src/lib/lib.gni @@ -12,7 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/chip.gni") +import("${chip_root}/src/lib/core/core.gni") + declare_args() { + # Build controller library. + chip_build_controller = chip_target_style != "embedded" + # Enable libshell support. chip_build_libshell = false diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index fd89be709e1a20..b59e0602edb63b 100755 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include diff --git a/src/platform/webos/ThreadStackManagerImpl.cpp b/src/platform/webos/ThreadStackManagerImpl.cpp index 3b0bea0eeec628..b6e4bd9e9a853e 100644 --- a/src/platform/webos/ThreadStackManagerImpl.cpp +++ b/src/platform/webos/ThreadStackManagerImpl.cpp @@ -25,6 +25,8 @@ #include #include +#include + #include #include #include diff --git a/src/protocols/secure_channel/CASEDestinationId.cpp b/src/protocols/secure_channel/CASEDestinationId.cpp index 17eac22b1409a5..538bda9cb05453 100644 --- a/src/protocols/secure_channel/CASEDestinationId.cpp +++ b/src/protocols/secure_channel/CASEDestinationId.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "CASEDestinationId.h" From 2926ff7c9275ed606681a9809e44c3efa241a2e1 Mon Sep 17 00:00:00 2001 From: weicheng Date: Thu, 15 Jun 2023 21:05:19 +0800 Subject: [PATCH 12/31] [ASR] generate OTA image automatically (#27211) * [ASR] generate OTA image automatically and update README * rename ota image action --- examples/ota-requestor-app/asr/README.md | 20 +++++---- third_party/asr/asr_executable.gni | 54 ++++++++++++++++++++---- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/examples/ota-requestor-app/asr/README.md b/examples/ota-requestor-app/asr/README.md index d0dcc9f7146554..d8d5b7f9de2d03 100755 --- a/examples/ota-requestor-app/asr/README.md +++ b/examples/ota-requestor-app/asr/README.md @@ -30,19 +30,23 @@ guides to get started ## Testing the example -- Make OTA image: Taking lighting-app as an example, light project must - compiled before this operation: +- After building a application, `*ota.bin` will generated automatically in the + output directory. + +- Use + [ota_image_tool](https://github.com/project-chip/connectedhomeip/blob/master/src/app/ota_image_tool.py) + to generate the Matter OTA image. This tool can be used as follows, make + sure the softwareVersion parameter must be greater than the + `CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION` parameter set in the + application's CHIPProjectConfig.h file. ``` - third_party/asr/asr582x/asr_sdk/tools/otaImage/image_gen_header out/asr-asr582x-lighting/chip-asr-lighting-example.bin flash_remapping + ./src/app/ota_image_tool.py create -v -p -vn 2 -vs "2.0" -da sha256 application_ota.bin matter_firmware_ota.bin ``` - After that, `chip-asr-lighting-example.ota.bin` will generated in the - directory `./out/asr-asr582x-lighting/`. - - Run the Linux OTA Provider with OTA image. ``` - ./chip-ota-provider-app -f chip-asr-lighting-example.ota.bin + ./chip-ota-provider-app -f matter_firmware_ota.bin ``` - OTA Provider commissioning in another Linux terminal. ``` @@ -57,5 +61,5 @@ guides to get started - After OTA Requestor commissioning is successful, use `chip-tool` to inform OTA Provider to send OTA image to OTA Requestor. ``` - ./chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 0 + ./chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 0 ``` diff --git a/third_party/asr/asr_executable.gni b/third_party/asr/asr_executable.gni index 8347b02ef77265..0be41a4b120e8d 100644 --- a/third_party/asr/asr_executable.gni +++ b/third_party/asr/asr_executable.gni @@ -25,18 +25,54 @@ template("asr_executable") { if (asr_ic_family == "asr595x") { objcopy = "${asr_toolchain_root}riscv-asr-elf-objcopy" - } else if (asr_ic_family == "asr582x") { - objcopy = "${asr_toolchain_root}arm-none-eabi-objcopy" } else { - objcopy = "objcopy" + objcopy = "${asr_toolchain_root}arm-none-eabi-objcopy" } - #Copy flashing dependencies to the output directory so that the output - #is collectively self-contained; this allows flashing to work reliably - #even if the build and flashing steps take place on different machines - #or in different containers. - - flashable_executable(target_name) { + flash_target_name = target_name + ".flash_executable" + flashbundle_name = "${target_name}.flashbundle.txt" + flashable_executable(flash_target_name) { forward_variables_from(invoker, "*") } + + action("generate_ota_image") { + script = "${build_root}/gn_run_binary.py" + + outputs = [ "${root_out_dir}/${output_base_name}_ota.bin" ] + + if (asr_ic_family == "asr595x") { + gen_ota_tool = "${asr_sdk_build_root}/asr_sdk/tools/image_gen_header/image_gen_header" + } else { + gen_ota_tool = + "${asr_sdk_build_root}/asr_sdk/tools/otaImage/image_gen_header" + } + + _ota_tool_path = rebase_path(gen_ota_tool, root_build_dir) + + if (asr_ic_family == "asr595x") { + args = [ + _ota_tool_path, + "${root_out_dir}/${objcopy_image_name}", + "-d", + "LEGA_A0V2", + "-b", + "REMAPPING", + ] + } else { + args = [ + _ota_tool_path, + "${root_out_dir}/${objcopy_image_name}", + "flash_remapping", + ] + } + + deps = [ ":$flash_target_name" ] + } + + group(target_name) { + deps = [ + ":$flash_target_name", + ":generate_ota_image", + ] + } } From a870765e2ad3870a77b726fefe5f34b83a0cdbbc Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 15 Jun 2023 09:21:45 -0400 Subject: [PATCH 13/31] Quiet the ZAP tests (#27255) Switch from action to pw_python_action to redirect the build output from the test ZAP generation. The output will only be printed if the step fails. --- scripts/tools/zap/BUILD.gn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/tools/zap/BUILD.gn b/scripts/tools/zap/BUILD.gn index 67dedad0fcb542..246b2dd44b3259 100644 --- a/scripts/tools/zap/BUILD.gn +++ b/scripts/tools/zap/BUILD.gn @@ -14,8 +14,11 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") -action("tests") { +import("$dir_pw_build/python.gni") + +pw_python_action("tests") { script = "test_generate.py" _stamp = "${target_gen_dir}/generate.test.passed" From fb5558dd0be7aa966b96d0d8bae8e4184866a5c4 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Thu, 15 Jun 2023 09:29:02 -0400 Subject: [PATCH 14/31] fix a merge issue by readding mICDEventManager.Init() and .Shutdown() in server.cpp. (#27265) --- src/app/server/Server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 75a4262716f5a8..0793832d17271c 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -247,6 +247,10 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) } #endif // CHIP_CONFIG_ENABLE_SERVER_IM_EVENT +#ifdef CHIP_CONFIG_ENABLE_ICD_SERVER + mICDEventManager.Init(&mICDManager); +#endif // CHIP_CONFIG_ENABLE_ICD_SERVER + // This initializes clusters, so should come after lower level initialization. InitDataModelHandler(); @@ -484,6 +488,9 @@ void Server::Shutdown() mAccessControl.Finish(); Access::ResetAccessControlToDefault(); Credentials::SetGroupDataProvider(nullptr); +#ifdef CHIP_CONFIG_ENABLE_ICD_SERVER + mICDEventManager.Shutdown(); +#endif // CHIP_CONFIG_ENABLE_ICD_SERVER mAttributePersister.Shutdown(); // TODO(16969): Remove chip::Platform::MemoryInit() call from Server class, it belongs to outer code chip::Platform::MemoryShutdown(); From 5efdd3118ccaa5fc6b3084c33170e8e3a666bbf3 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 15 Jun 2023 09:33:07 -0400 Subject: [PATCH 15/31] [Scenes] Scene Handler Encode and Decode attribute value list (#27089) * Added Encode and Decode helper functions for SceneHandlers to avoid code dupplication * Moved functions from SceneHandler in SceneTableImpl.cpp, applied comments * Removed unused container in SceneHandler encode/decode of attributeValue lists * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Restyled by clang-format --------- Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io --- .../clusters/scenes-server/SceneTableImpl.cpp | 79 ++++++++++++++ .../clusters/scenes-server/SceneTableImpl.h | 101 +++++------------- src/app/tests/TestSceneTable.cpp | 78 ++------------ 3 files changed, 114 insertions(+), 144 deletions(-) diff --git a/src/app/clusters/scenes-server/SceneTableImpl.cpp b/src/app/clusters/scenes-server/SceneTableImpl.cpp index f4e3de33d94634..99d14e97095aab 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.cpp +++ b/src/app/clusters/scenes-server/SceneTableImpl.cpp @@ -22,6 +22,85 @@ namespace chip { namespace scenes { +CHIP_ERROR +DefaultSceneHandlerImpl::EncodeAttributeValueList( + const app::DataModel::List & aVlist, + MutableByteSpan & serializedBytes) +{ + TLV::TLVWriter writer; + writer.Init(serializedBytes); + ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag(), aVlist)); + serializedBytes.reduce_size(writer.GetLengthWritten()); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DefaultSceneHandlerImpl::DecodeAttributeValueList( + const ByteSpan & serializedBytes, + app::DataModel::DecodableList & aVlist) +{ + TLV::TLVReader reader; + + reader.Init(serializedBytes); + ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Array, TLV::AnonymousTag())); + ReturnErrorOnFailure(aVlist.Decode(reader)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DefaultSceneHandlerImpl::SerializeAdd(EndpointId endpoint, + const app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & extensionFieldSet, + MutableByteSpan & serializedBytes) +{ + app::Clusters::Scenes::Structs::AttributeValuePair::Type aVPairs[kMaxAvPair]; + + size_t pairTotal = 0; + // Verify size of list + ReturnErrorOnFailure(extensionFieldSet.attributeValueList.ComputeSize(&pairTotal)); + VerifyOrReturnError(pairTotal <= ArraySize(aVPairs), CHIP_ERROR_BUFFER_TOO_SMALL); + + uint8_t pairCount = 0; + auto pair_iterator = extensionFieldSet.attributeValueList.begin(); + while (pair_iterator.Next()) + { + aVPairs[pairCount] = pair_iterator.GetValue(); + pairCount++; + } + ReturnErrorOnFailure(pair_iterator.GetStatus()); + app::DataModel::List attributeValueList(aVPairs, pairCount); + + return EncodeAttributeValueList(attributeValueList, serializedBytes); +} + +CHIP_ERROR DefaultSceneHandlerImpl::Deserialize(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, + app::Clusters::Scenes::Structs::ExtensionFieldSet::Type & extensionFieldSet) +{ + app::DataModel::DecodableList attributeValueList; + + ReturnErrorOnFailure(DecodeAttributeValueList(serializedBytes, attributeValueList)); + + // Verify size of list + size_t pairTotal = 0; + ReturnErrorOnFailure(attributeValueList.ComputeSize(&pairTotal)); + VerifyOrReturnError(pairTotal <= ArraySize(mAVPairs), CHIP_ERROR_BUFFER_TOO_SMALL); + + uint8_t pairCount = 0; + auto pair_iterator = attributeValueList.begin(); + while (pair_iterator.Next()) + { + mAVPairs[pairCount] = pair_iterator.GetValue(); + pairCount++; + }; + ReturnErrorOnFailure(pair_iterator.GetStatus()); + + extensionFieldSet.clusterID = cluster; + extensionFieldSet.attributeValueList = mAVPairs; + extensionFieldSet.attributeValueList.reduce_size(pairCount); + + return CHIP_NO_ERROR; +} + /// @brief Tags Used to serialize Scenes so they can be stored in flash memory. /// kSceneCount: Number of scenes in a Fabric /// kStorageIDArray: Array of StorageID struct diff --git a/src/app/clusters/scenes-server/SceneTableImpl.h b/src/app/clusters/scenes-server/SceneTableImpl.h index b70a50ba1e8155..b162f819b4a747 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.h +++ b/src/app/clusters/scenes-server/SceneTableImpl.h @@ -46,94 +46,41 @@ class DefaultSceneHandlerImpl : public scenes::SceneHandler DefaultSceneHandlerImpl() = default; ~DefaultSceneHandlerImpl() override{}; + /// @brief Encodes an attribute value list into a TLV structure and resizes the buffer to the size of the encoded data + /// @param aVlist[in] Attribute value list to encode + /// @param serializedBytes[out] Buffer to fill from the Attribute value list in a TLV format + /// @return CHIP_ERROR + virtual CHIP_ERROR + EncodeAttributeValueList(const app::DataModel::List & aVlist, + MutableByteSpan & serializedBytes); + + /// @brief Decodes an attribute value list from a TLV structure and ensure it fits the member pair buffer + /// @param serializedBytes [in] Buffer to read from + /// @param aVlist [out] Attribute value list to fill from the TLV structure. Only valid while the buffer backing + /// serializedBytes exists and its contents are not modified. + /// @return CHIP_ERROR + virtual CHIP_ERROR DecodeAttributeValueList( + const ByteSpan & serializedBytes, + app::DataModel::DecodableList & aVlist); + /// @brief From command AddScene, allows handler to filter through clusters in command to serialize only the supported ones. /// @param endpoint[in] Endpoint ID /// @param extensionFieldSet[in] ExtensionFieldSets provided by the AddScene Command, pre initialized - /// @param serialisedBytes[out] Buffer to fill from the ExtensionFieldSet in command - /// @return CHIP_NO_ERROR if successful, CHIP_ERROR_INVALID_ARGUMENT if the cluster is not supported, CHIP_ERROR value otherwise + /// @param serializedBytes[out] Buffer to fill from the ExtensionFieldSet in command + /// @return CHIP_NO_ERROR if successful, CHIP_ERROR_INVALID_ARGUMENT if the cluster is not supported, CHIP_ERROR value + /// otherwise virtual CHIP_ERROR SerializeAdd(EndpointId endpoint, const app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & extensionFieldSet, - MutableByteSpan & serializedBytes) override - { - app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType aVPair; - TLV::TLVWriter writer; - TLV::TLVType outer; - size_t pairTotal = 0; - uint8_t pairCount = 0; - - // Verify size of list - ReturnErrorOnFailure(extensionFieldSet.attributeValueList.ComputeSize(&pairTotal)); - VerifyOrReturnError(pairTotal <= ArraySize(mAVPairs), CHIP_ERROR_BUFFER_TOO_SMALL); - - auto pair_iterator = extensionFieldSet.attributeValueList.begin(); - while (pair_iterator.Next()) - { - aVPair = pair_iterator.GetValue(); - mAVPairs[pairCount].attributeID = aVPair.attributeID; - mAVPairs[pairCount].attributeValue = aVPair.attributeValue; - pairCount++; - } - ReturnErrorOnFailure(pair_iterator.GetStatus()); - - app::DataModel::List attributeValueList; - attributeValueList = mAVPairs; - attributeValueList.reduce_size(pairCount); - - writer.Init(serializedBytes); - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(app::DataModel::Encode( - writer, TLV::ContextTag(app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList), - attributeValueList)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - - return CHIP_NO_ERROR; - } + MutableByteSpan & serializedBytes) override; /// @brief Simulates taking data from nvm and loading it in a command object if the cluster is supported by the endpoint /// @param endpoint target endpoint /// @param cluster target cluster - /// @param serialisedBytes data to deserialize into EFS + /// @param serializedBytes data to deserialize into EFS /// @return CHIP_NO_ERROR if Extension Field Set was successfully populated, CHIP_ERROR_INVALID_ARGUMENT if the cluster is not /// supported, specific CHIP_ERROR otherwise - virtual CHIP_ERROR Deserialize(EndpointId endpoint, ClusterId cluster, const ByteSpan & serialisedBytes, - app::Clusters::Scenes::Structs::ExtensionFieldSet::Type & extensionFieldSet) override - { - app::DataModel::DecodableList attributeValueList; - app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType decodePair; - - TLV::TLVReader reader; - TLV::TLVType outer; - size_t pairTotal = 0; - uint8_t pairCount = 0; - - extensionFieldSet.clusterID = cluster; - reader.Init(serialisedBytes); - ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag())); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - ReturnErrorOnFailure(reader.Next( - TLV::kTLVType_Array, TLV::ContextTag(app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList))); - attributeValueList.Decode(reader); - - // Verify size of list - ReturnErrorOnFailure(attributeValueList.ComputeSize(&pairTotal)); - VerifyOrReturnError(pairTotal <= ArraySize(mAVPairs), CHIP_ERROR_BUFFER_TOO_SMALL); - - auto pair_iterator = attributeValueList.begin(); - while (pair_iterator.Next()) - { - decodePair = pair_iterator.GetValue(); - mAVPairs[pairCount].attributeID = decodePair.attributeID; - mAVPairs[pairCount].attributeValue = decodePair.attributeValue; - pairCount++; - }; - ReturnErrorOnFailure(pair_iterator.GetStatus()); - - ReturnErrorOnFailure(reader.ExitContainer(outer)); - extensionFieldSet.attributeValueList = mAVPairs; - extensionFieldSet.attributeValueList.reduce_size(pairCount); - - return CHIP_NO_ERROR; - } + virtual CHIP_ERROR Deserialize(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, + app::Clusters::Scenes::Structs::ExtensionFieldSet::Type & extensionFieldSet) override; private: app::Clusters::Scenes::Structs::AttributeValuePair::Type mAVPairs[kMaxAvPair]; diff --git a/src/app/tests/TestSceneTable.cpp b/src/app/tests/TestSceneTable.cpp index 8bbbdb350fb900..b45bc3ee67dd28 100644 --- a/src/app/tests/TestSceneTable.cpp +++ b/src/app/tests/TestSceneTable.cpp @@ -473,8 +473,6 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) TLV::TLVReader reader; TLV::TLVWriter writer; - TLV::TLVType outer; - TLV::TLVType outerRead; static const uint8_t OO_av_payload = 0x01; static const uint16_t LC_av_payload[2] = { 0x64, 0x01F0 }; @@ -522,36 +520,18 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Serialize Extension Field sets as if they were recovered from memory writer.Init(OO_buffer); - writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer); NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - OOextensionFieldSet.attributeValueList)); - writer.EndContainer(outer); + CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), OOextensionFieldSet.attributeValueList)); OO_buffer_serialized_length = writer.GetLengthWritten(); writer.Init(LC_buffer); - writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer); NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - LCextensionFieldSet.attributeValueList)); - writer.EndContainer(outer); + CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), LCextensionFieldSet.attributeValueList)); LC_buffer_serialized_length = writer.GetLengthWritten(); writer.Init(CC_buffer); - writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer); NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - CCextensionFieldSet.attributeValueList)); - writer.EndContainer(outer); + CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), CCextensionFieldSet.attributeValueList)); CC_buffer_serialized_length = writer.GetLengthWritten(); // Test Registering SceneHandler @@ -562,10 +542,7 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) reader.Init(OO_list); extensionFieldSetIn.clusterID = kOnOffClusterId; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.EnterContainer(outerRead)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == extensionFieldSetIn.attributeValueList.Decode(reader)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.ExitContainer(outerRead)); NL_TEST_ASSERT(aSuite, sHandler.SupportsCluster(kTestEndpoint1, extensionFieldSetIn.clusterID)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sHandler.SerializeAdd(kTestEndpoint1, extensionFieldSetIn, buff_span)); @@ -573,15 +550,13 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Verify the handler extracted buffer matches the initial field sets NL_TEST_ASSERT(aSuite, 0 == memcmp(OO_list.data(), buff_span.data(), buff_span.size())); memset(buffer, 0, buff_span.size()); + buff_span = MutableByteSpan(buffer); // Setup the Level Control Extension field set in the expected state from a command reader.Init(LC_list); extensionFieldSetIn.clusterID = kLevelControlClusterId; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.EnterContainer(outerRead)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == extensionFieldSetIn.attributeValueList.Decode(reader)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.ExitContainer(outerRead)); NL_TEST_ASSERT(aSuite, sHandler.SupportsCluster(kTestEndpoint1, extensionFieldSetIn.clusterID)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sHandler.SerializeAdd(kTestEndpoint1, extensionFieldSetIn, buff_span)); @@ -589,15 +564,13 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Verify the handler extracted buffer matches the initial field sets NL_TEST_ASSERT(aSuite, 0 == memcmp(LC_list.data(), buff_span.data(), buff_span.size())); memset(buffer, 0, buff_span.size()); + buff_span = MutableByteSpan(buffer); // Setup the Color control Extension field set in the expected state from a command reader.Init(CC_list); extensionFieldSetIn.clusterID = kColorControlClusterId; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.EnterContainer(outerRead)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == extensionFieldSetIn.attributeValueList.Decode(reader)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.ExitContainer(outerRead)); NL_TEST_ASSERT(aSuite, sHandler.SupportsCluster(kTestEndpoint1, extensionFieldSetIn.clusterID)); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == sHandler.SerializeAdd(kTestEndpoint1, extensionFieldSetIn, buff_span)); @@ -605,6 +578,7 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Verify the handler extracted buffer matches the initial field sets NL_TEST_ASSERT(aSuite, 0 == memcmp(CC_list.data(), buff_span.data(), buff_span.size())); memset(buffer, 0, buff_span.size()); + buff_span = MutableByteSpan(buffer); // Verify Deserializing is properly filling out output extension field set for on off NL_TEST_ASSERT(aSuite, sHandler.SupportsCluster(kTestEndpoint1, kOnOffClusterId)); @@ -612,14 +586,8 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Verify Encoding the Extension field set returns the same data as the one serialized for on off previously writer.Init(buff_span); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)); NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - extensionFieldSetOut.attributeValueList)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == writer.EndContainer(outer)); + CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), extensionFieldSetOut.attributeValueList)); NL_TEST_ASSERT(aSuite, 0 == memcmp(OO_list.data(), buff_span.data(), buff_span.size())); memset(buffer, 0, buff_span.size()); @@ -630,14 +598,8 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Verify Encoding the Extension field set returns the same data as the one serialized for level control previously writer.Init(buff_span); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)); NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - extensionFieldSetOut.attributeValueList)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == writer.EndContainer(outer)); + CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), extensionFieldSetOut.attributeValueList)); NL_TEST_ASSERT(aSuite, 0 == memcmp(LC_list.data(), buff_span.data(), buff_span.size())); memset(buffer, 0, buff_span.size()); @@ -648,14 +610,8 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Verify Encoding the Extension field set returns the same data as the one serialized for color control previously writer.Init(buff_span); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)); NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - extensionFieldSetOut.attributeValueList)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == writer.EndContainer(outer)); + CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), extensionFieldSetOut.attributeValueList)); NL_TEST_ASSERT(aSuite, 0 == memcmp(CC_list.data(), buff_span.data(), buff_span.size())); memset(buffer, 0, buff_span.size()); @@ -664,9 +620,6 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType extensionFieldFailTestIn; app::Clusters::Scenes::Structs::AttributeValuePair::Type TooManyPairs[16]; - TLV::TLVType failWrite; - TLV::TLVType failRead; - uint8_t payloadOk = 0; for (uint8_t i = 0; i < 16; i++) @@ -682,23 +635,14 @@ void TestHandlerFunctions(nlTestSuite * aSuite, void * aContext) // Serialize Extension Field sets as if they were recovered from memory writer.Init(failBuffer); - writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, failWrite); - NL_TEST_ASSERT(aSuite, - CHIP_NO_ERROR == - app::DataModel::Encode(writer, - TLV::ContextTag(to_underlying( - app::Clusters::Scenes::Structs::ExtensionFieldSet::Fields::kAttributeValueList)), - extensionFieldFailTestOut.attributeValueList)); - writer.EndContainer(failWrite); + NL_TEST_ASSERT( + aSuite, CHIP_NO_ERROR == app::DataModel::Encode(writer, TLV::AnonymousTag(), extensionFieldFailTestOut.attributeValueList)); // Setup the On Off Extension field set in the expected state from a command reader.Init(fail_list); extensionFieldFailTestIn.clusterID = kColorControlClusterId; NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.EnterContainer(failRead)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.Next()); NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == extensionFieldFailTestIn.attributeValueList.Decode(reader)); - NL_TEST_ASSERT(aSuite, CHIP_NO_ERROR == reader.ExitContainer(failRead)); // Verify failure on both serialize and deserialize NL_TEST_ASSERT(aSuite, From 82438f5615722989a39ca92ace5f105959efcc59 Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:16:49 -0400 Subject: [PATCH 16/31] [Feature] RVC operational state cluster xml (#26989) * add non-generated code * add generated files * Update .github/workflows/tests.yaml * address code review feedback * Update src/controller/data_model/BUILD.gn * Apply suggestions from code review * add generated code * Update src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml * add generated code * add missing EOL * address code review feedback * update the RVC and the generic OpState XMLs * fix typo + indentation * enable the stop and start commands in the controller clusters zap file * add RVC OpState cluster to OpState struct definitions * remove spaces at the end of the line --- .github/workflows/tests.yaml | 1 + .gitignore | 1 + .../all-clusters-app.matter | 11 + .../all-clusters-minimal-app.matter | 11 + .../bridge-common/bridge-app.matter | 11 + ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 11 + ...de_colortemperaturelight_hbUnzYVeyn.matter | 11 + .../rootnode_contactsensor_lFAGG1bfRO.matter | 11 + .../rootnode_dimmablelight_bCwGYSDpoe.matter | 11 + .../rootnode_doorlock_aNKYAreMXE.matter | 11 + ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 11 + .../devices/rootnode_fan_7N2TobIlOX.matter | 11 + .../rootnode_flowsensor_1zVxHedlaV.matter | 11 + ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 11 + .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 11 + .../rootnode_lightsensor_lZQycTFcJK.matter | 11 + ...rootnode_occupancysensor_iHyVgifZuo.matter | 11 + .../rootnode_onofflight_bbs1b7IaOV.matter | 11 + ...ootnode_onofflightswitch_FsPlMr090Q.matter | 11 + ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 11 + .../rootnode_pressuresensor_s0qC9wLH4k.matter | 11 + .../devices/rootnode_pump_a811bb33a0.matter | 11 + .../rootnode_speaker_RpzeXdimqA.matter | 11 + ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 11 + .../rootnode_thermostat_bm3fb8dhYi.matter | 11 + .../rootnode_windowcovering_RLCxaGi9Yx.matter | 11 + .../contact-sensor-app.matter | 11 + .../light-switch-app.matter | 11 + .../data_model/lighting-app-thread.matter | 11 + .../data_model/lighting-app-wifi.matter | 11 + .../lighting-common/lighting-app.matter | 11 + .../nxp/zap/lighting-on-off.matter | 11 + examples/lighting-app/qpg/zap/light.matter | 11 + .../data_model/lighting-thread-app.matter | 11 + .../data_model/lighting-wifi-app.matter | 11 + examples/lock-app/lock-common/lock-app.matter | 11 + examples/lock-app/nxp/zap/lock-app.matter | 11 + examples/lock-app/qpg/zap/lock.matter | 11 + .../log-source-common/log-source-app.matter | 11 + .../ota-provider-app.matter | 11 + .../ota-requestor-app.matter | 11 + .../placeholder/linux/apps/app1/config.matter | 11 + .../placeholder/linux/apps/app2/config.matter | 11 + examples/pump-app/pump-common/pump-app.matter | 11 + .../pump-controller-app.matter | 11 + .../smoke-co-alarm-app.matter | 11 + .../temperature-measurement.matter | 11 + .../thermostat-common/thermostat.matter | 11 + examples/tv-app/tv-common/tv-app.matter | 11 + .../tv-casting-common/tv-casting-app.matter | 11 + examples/window-app/common/window-app.matter | 11 + scripts/rules.matterlint | 1 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../chip/operational-state-cluster.xml | 18 +- .../chip/operational-state-rvc-cluster.xml | 91 ++ .../zcl/zcl-with-test-extensions.json | 7 +- src/app/zap-templates/zcl/zcl.json | 7 +- src/app/zap_cluster_list.json | 1 + src/controller/data_model/BUILD.gn | 2 + .../data_model/controller-clusters.matter | 88 +- .../data_model/controller-clusters.zap | 340 ++++- .../devicecontroller/ClusterIDMapping.java | 115 ++ .../devicecontroller/ClusterReadMapping.java | 115 ++ .../devicecontroller/ClusterWriteMapping.java | 2 + .../CHIPAttributeTLVValueDecoder.cpp | 439 ++++++- .../java/zap-generated/CHIPClientCallbacks.h | 14 + .../CHIPEventTLVValueDecoder.cpp | 204 ++- .../zap-generated/CHIPInvokeCallbacks.cpp | 127 +- .../java/zap-generated/CHIPInvokeCallbacks.h | 16 + .../java/zap-generated/CHIPReadCallbacks.cpp | 626 +++++++++- .../chip/devicecontroller/ChipClusters.java | 304 +++++ .../devicecontroller/ChipEventStructs.java | 54 + .../chip/devicecontroller/ChipIdLookup.java | 51 + .../chip/devicecontroller/ChipStructs.java | 68 +- .../devicecontroller/ClusterInfoMapping.java | 228 ++++ .../python/chip/clusters/CHIPClusters.py | 106 ++ .../python/chip/clusters/Objects.py | 416 ++++++- .../MTRAttributeSpecifiedCheck.mm | 48 + .../MTRAttributeTLVValueDecoder.mm | 334 ++++- .../CHIP/zap-generated/MTRBaseClusters.h | 231 ++++ .../CHIP/zap-generated/MTRBaseClusters.mm | 724 +++++++++++ .../zap-generated/MTRBaseClusters_Internal.h | 5 + .../CHIP/zap-generated/MTRCallbackBridge.h | 475 +++++++ .../CHIP/zap-generated/MTRCallbackBridge.mm | 480 ++++++- .../CHIP/zap-generated/MTRClusterConstants.h | 32 + .../CHIP/zap-generated/MTRClusters.h | 77 ++ .../CHIP/zap-generated/MTRClusters.mm | 429 +++++++ .../CHIP/zap-generated/MTRClusters_Internal.h | 5 + .../zap-generated/MTRCommandPayloadsObjc.h | 132 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 211 +++- .../MTRCommandPayloads_Internal.h | 8 + .../zap-generated/MTREventTLVValueDecoder.mm | 105 +- .../CHIP/zap-generated/MTRStructsObjc.h | 27 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 130 +- .../zap-generated/attributes/Accessors.cpp | 174 +++ .../zap-generated/attributes/Accessors.h | 30 + .../app-common/zap-generated/callback.h | 109 ++ .../zap-generated/cluster-enums-check.h | 32 + .../app-common/zap-generated/cluster-enums.h | 34 + .../zap-generated/cluster-objects.cpp | 370 +++++- .../zap-generated/cluster-objects.h | 498 +++++++- .../app-common/zap-generated/ids/Attributes.h | 54 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 26 + .../app-common/zap-generated/ids/Events.h | 14 + .../app-common/zap-generated/print-cluster.h | 8 + .../zap-generated/cluster/Commands.h | 233 ++++ .../cluster/ComplexArgumentParser.cpp | 147 +-- .../cluster/ComplexArgumentParser.h | 20 +- .../cluster/logging/DataModelLogger.cpp | 269 +++- .../cluster/logging/DataModelLogger.h | 21 +- .../zap-generated/cluster/Commands.h | 1098 +++++++++++++++++ 112 files changed, 10214 insertions(+), 361 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2d641bb21a0e53..47ad5341ac7f4d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -167,6 +167,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml \ diff --git a/.gitignore b/.gitignore index 4c17bb63a84a8c..21a01b1000a779 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,4 @@ examples/thermostat/ameba/build # https://github.com/espressif/idf-component-manager#using-with-a-project examples/*/esp32/managed_components examples/*/esp32/dependencies.lock +examples/all-clusters-app/all-clusters-common/all-clusters-app.zap.old 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 dd8e49f387652d..02d9c1ddec2298 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 @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index ac09d5456eb636..104fa4b1dac252 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 6531edb1e75503..92cadc203dee65 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index a458da9d021e37..50a92f95409d58 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index ebc9e4e5486f58..54efa018e7cfa0 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 72da64cff277aa..bb701a18ee67f0 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index c8bbadd07fab6d..c2e5318a739ab1 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 7280968fb259fc..44034fc276cd9a 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index a7d53aaeecd93c..b3287ac4d76f5d 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 0ad9c02d5cc4c2..7ce96d6a1b79cc 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 3aab05c6ace501..cf1217be0a4a81 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 0c50e8602406b8..293c6f20d54f28 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index dbf22aa9b13b97..c92b8e34fd8d89 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 8f11a43bf3ac8e..a4ce7b2f50b217 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 174d400db5ea1c..2419ff7c662a6b 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 7bb540870bd8b6..58b80e234217b1 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index caffea35361731..75810385dd8bee 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 1502efbb5aac49..116c9888f85784 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 9deb03484943b1..156127529e8d0b 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 391a6975cd2737..96c4e8ccf06ba9 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 17f82500378cd3..f9b2b1a0bf7fed 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index e04574d866f334..3271ad89c92a0f 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index b0462727f5b4fc..694dc771797ce9 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index e4a671aad8c9ad..c2eea25c88feb7 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 18cdf112410294..a7a951c52a0ac2 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index eef00caa037cc2..054967c1f9ec29 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index d96ec9472c60cc..96ad29d946455b 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 9cfe2296c4c6e0..abea6c297c8826 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index e8a2e130590652..4a6f7909a556d7 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 52db5c7fafafb3..0ae348837f0df0 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 41c986eb8e0584..644724d1b7021c 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 35d143b87c10b5..c53787eaf6418e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index f57a222dae038f..65ec6c1f964fd6 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index f65707d1bf81a7..bbe991722a17f7 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 1991075fd9bb86..e006c0ff6baf09 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index a701a908691e9f..77dade82d35019 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 23798cde6f2219..f982536f029c5c 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 60ce28100ca0b7..1048f1f23d986f 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { struct DeviceTypeStruct { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 79eb0c8f93911d..624a7909f336f4 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 43897ccc850a9f..ced41db421494b 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index a08f06fd56a176..486524fe426c1b 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index 06e12a5b21d32d..e43d3afa2ca24c 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 15b6233cc69855..0025fb8aa63a3c 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index efe45e7e9a6c70..3ceab153db1fa4 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 1a2aaab3ae031a..d7a1ec6b003f64 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { struct DeviceTypeStruct { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 304de497411237..85fcfa9afbbbdf 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index c60e578a902dfe..11c4b348cbe8a2 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ server cluster OnOff = 6 { enum OnOffDelayedAllOffEffectVariant : ENUM8 { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index a2e66c29348bca..559e42c257415c 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 409aec2feb4ca6..ba4f26b31b963b 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ server cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 69a6cee7f88af0..7134768396864a 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -50,6 +50,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml load "../src/app/zap-templates/zcl/data-model/chip/onoff-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/operational-credentials-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/power-source-configuration-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pressure-measurement-cluster.xml"; diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 849921d488c814..7aec7f0f260116 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -49,6 +49,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml index de156b7a726041..e454bbee517ae3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-cluster.xml @@ -35,15 +35,17 @@ limitations under the License. - - + + + - - - + + + + @@ -59,10 +61,10 @@ limitations under the License. PhaseList CurrentPhase - CountdownTime + CountdownTime OperationalStateList OperationalState - OperationalError + OperationalError Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. @@ -92,7 +94,7 @@ limitations under the License. OperationCompletion - + diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml new file mode 100644 index 00000000000000..c568f3f873871f --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Robots + Robotic Vacuum Operational State + 0x0061 + OPERATIONAL_STATE_RVC_CLUSTER + true + true + This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + + + + PhaseList + CurrentPhase + CountdownTime + OperationalStateList + OperationalState + OperationalError + + + Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. + + + + Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. + + + + Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. + + + + Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). + + + + This command SHALL be generated in response to any of the Start, Stop, Pause, or Resume commands. + + + + + OperationalError + + + + + OperationCompletion + + + + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 24be37cd01d7d1..3e52c910fe02d5 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -67,6 +67,7 @@ "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", + "operational-state-rvc-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -300,7 +301,11 @@ "LocalTime" ], "Temperature Control": ["SupportedTemperatureLevels"], - "Operational State": ["OperationalState", "OperationalError"] + "Operational State": ["OperationalState", "OperationalError"], + "Robotic Vacuum Operational State": [ + "OperationalState", + "OperationalError" + ] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 220ce3a3c9574f..91567280ea4764 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -65,6 +65,7 @@ "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", + "operational-state-rvc-cluster.xml", "pressure-measurement-cluster.xml", "power-source-cluster.xml", "power-source-configuration-cluster.xml", @@ -298,7 +299,11 @@ "LocalTime" ], "Temperature Control": ["SupportedTemperatureLevels"], - "Operational State": ["OperationalState", "OperationalError"] + "Operational State": ["OperationalState", "OperationalError"], + "Robotic Vacuum Operational State": [ + "OperationalState", + "OperationalError" + ] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index ae3c9ff51732e2..0e7b0c1593cd6a 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -84,6 +84,7 @@ "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": [], "OPERATIONAL_STATE_CLUSTER": [], + "OPERATIONAL_STATE_RVC_CLUSTER": [], "OTA_BOOTLOAD_CLUSTER": [], "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": [], "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": [], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 88eee715a7f08f..698c950b3b81d0 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -242,6 +242,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", + "jni/RoboticVacuumOperationalStateClient-InvokeSubscribeImpl.cpp", + "jni/RoboticVacuumOperationalStateClient-ReadImpl.cpp", "jni/RvcCleanModeSelectClient-InvokeSubscribeImpl.cpp", "jni/RvcCleanModeSelectClient-ReadImpl.cpp", "jni/RvcRunModeSelectClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 8515fe3b3d9d41..2da11212f13c50 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -18,11 +18,22 @@ struct ApplicationStruct { char_string applicationID = 1; } +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + struct LabelStruct { char_string<16> label = 0; char_string<16> value = 1; } +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ client cluster Identify = 3 { enum EffectIdentifierEnum : ENUM8 { @@ -3357,14 +3368,81 @@ client cluster OperationalState = 96 { } struct ErrorStateStruct { - ErrorStateEnum errorStateID = 0; - nullable char_string<64> errorStateLabel = 1; + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + ENUM8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable CHAR_STRING phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateStruct operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + 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; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ +client cluster RoboticVacuumOperationalState = 97 { + enum ErrorStateEnum : ENUM8 { + kFailedToFindChargingDock = 64; + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + } + + enum OperationalStateEnum : ENUM8 { + kSeekingCharger = 64; + kCharging = 65; + kDocked = 66; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; optional char_string<64> errorStateDetails = 2; } struct OperationalStateStruct { - OperationalStateEnum operationalStateID = 0; - char_string<64> operationalStateLabel = 1; + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; } critical event OperationalError = 0 { @@ -3372,7 +3450,7 @@ client cluster OperationalState = 96 { } info event OperationCompletion = 1 { - ErrorStateEnum completionErrorCode = 0; + ENUM8 completionErrorCode = 0; optional nullable elapsed_s totalOperationalTime = 1; optional nullable elapsed_s pausedTime = 2; } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index c393c9e320bc7f..238e6e3cd83233 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -11292,7 +11292,7 @@ "side": "server", "type": "array", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11356,7 +11356,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11372,7 +11372,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11388,7 +11388,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11404,7 +11404,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11966,16 +11966,6 @@ "define": "REFRIGERATOR_ALARM", "side": "client", "enabled": 1, - "commands": [ - { - "name": "Reset", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - } - ], "attributes": [ { "name": "FeatureMap", @@ -12035,22 +12025,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "Latch", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "AlarmMap", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "State", "code": 2, @@ -13179,6 +13153,310 @@ } ] }, + { + "name": "Robotic Vacuum Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "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": "Robotic Vacuum Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "PhaseList", + "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": "CurrentPhase", + "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": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "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": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "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": "0", + "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 + } + ], + "events": [ + { + "name": "OperationalError", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "OperationCompletion", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, { "name": "HEPA Filter Monitoring", "code": 113, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index f95bd3e9867c45..9b988ead4d2a73 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -187,6 +187,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == OperationalState.ID) { return new OperationalState(); } + if (clusterId == RoboticVacuumOperationalState.ID) { + return new RoboticVacuumOperationalState(); + } if (clusterId == HepaFilterMonitoring.ID) { return new HepaFilterMonitoring(); } @@ -7706,6 +7709,118 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class RoboticVacuumOperationalState implements BaseCluster { + public static final long ID = 97L; + public long getID() { + return ID; + } + + public enum Attribute { + PhaseList(0L), + CurrentPhase(1L), + CountdownTime(2L), + OperationalStateList(3L), + OperationalState(4L), + OperationalError(5L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + OperationalError(0L), + OperationCompletion(1L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Pause(0L), + Stop(1L), + Start(2L), + Resume(3L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class HepaFilterMonitoring implements BaseCluster { public static final long ID = 113L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 40a742a4b047ad..5b67e5c2e3247b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7420,6 +7420,120 @@ private static Map readOperationalStateInteractionInfo( return result; } + private static Map readRoboticVacuumOperationalStateInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRoboticVacuumOperationalStatePhaseListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readPhaseListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback(), + readRoboticVacuumOperationalStatePhaseListCommandParams + ); + result.put("readPhaseListAttribute", readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCurrentPhaseAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback(), + readRoboticVacuumOperationalStateCurrentPhaseCommandParams + ); + result.put("readCurrentPhaseAttribute", readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCountdownTimeAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback(), + readRoboticVacuumOperationalStateCountdownTimeCommandParams + ); + result.put("readCountdownTimeAttribute", readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readOperationalStateListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback(), + readRoboticVacuumOperationalStateOperationalStateListCommandParams + ); + result.put("readOperationalStateListAttribute", readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback(), + readRoboticVacuumOperationalStateGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback(), + readRoboticVacuumOperationalStateAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readEventListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback(), + readRoboticVacuumOperationalStateEventListCommandParams + ); + result.put("readEventListAttribute", readRoboticVacuumOperationalStateEventListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAttributeListAttribute( + (ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback(), + readRoboticVacuumOperationalStateAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readRoboticVacuumOperationalStateFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo); + Map readRoboticVacuumOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readRoboticVacuumOperationalStateClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readHepaFilterMonitoringInteractionInfo() { Map result = new LinkedHashMap<>();Map readHepaFilterMonitoringConditionCommandParams = new LinkedHashMap(); InteractionInfo readHepaFilterMonitoringConditionAttributeInteractionInfo = new InteractionInfo( @@ -23222,6 +23336,7 @@ public Map> getReadAttributeMap() { put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); + put("roboticVacuumOperationalState", readRoboticVacuumOperationalStateInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); put("activatedCarbonFilterMonitoring", readActivatedCarbonFilterMonitoringInteractionInfo()); put("ceramicFilterMonitoring", readCeramicFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 3028e3525125f5..659c5d0ee3dc1d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1078,6 +1078,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); + Map writeRoboticVacuumOperationalStateInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("roboticVacuumOperationalState", writeRoboticVacuumOperationalStateInteractionInfo); Map writeHepaFilterMonitoringInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("hepaFilterMonitoring", writeHepaFilterMonitoringInteractionInfo); Map writeActivatedCarbonFilterMonitoringInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 0248cc27172020..615c368c0707c8 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -15011,10 +15011,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), - static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + entry_0.operationalStateID, newElement_0_operationalStateID); jobject newElement_0_operationalStateLabel; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, - newElement_0_operationalStateLabel)); + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.operationalStateLabel.Value(), newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -15026,7 +15036,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID operationalStateStructStructCtor_1 = - env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -15051,12 +15061,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value_operationalStateID; std::string value_operationalStateIDClassName = "java/lang/Integer"; std::string value_operationalStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_operationalStateIDClassName.c_str(), value_operationalStateIDCtorSignature.c_str(), - static_cast(cppValue.operationalStateID), value_operationalStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_operationalStateIDClassName.c_str(), + value_operationalStateIDCtorSignature.c_str(), + cppValue.operationalStateID, value_operationalStateID); jobject value_operationalStateLabel; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel, value_operationalStateLabel)); + if (!cppValue.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_operationalStateLabel); + } + else + { + jobject value_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel.Value(), + value_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_operationalStateLabelInsideOptional, + value_operationalStateLabel); + } jclass operationalStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( @@ -15068,7 +15088,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID operationalStateStructStructCtor_0 = - env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -15091,18 +15111,20 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value_errorStateID; std::string value_errorStateIDClassName = "java/lang/Integer"; std::string value_errorStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_errorStateIDClassName.c_str(), value_errorStateIDCtorSignature.c_str(), - static_cast(cppValue.errorStateID), value_errorStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_errorStateIDClassName.c_str(), + value_errorStateIDCtorSignature.c_str(), + cppValue.errorStateID, value_errorStateID); jobject value_errorStateLabel; - if (cppValue.errorStateLabel.IsNull()) + if (!cppValue.errorStateLabel.HasValue()) { - value_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateLabel); } else { - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), value_errorStateLabel)); + jobject value_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), + value_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateLabelInsideOptional, value_errorStateLabel); } jobject value_errorStateDetails; if (!cppValue.errorStateDetails.HasValue()) @@ -15126,7 +15148,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( - errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -15269,6 +15291,387 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::RoboticVacuumOperationalState::Id: { + using namespace app::Clusters::RoboticVacuumOperationalState; + switch (aPath.mAttributeId) + { + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) + { + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1, newElement_1)); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } + } + return value; + } + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_operationalStateID; + std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; + std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.operationalStateLabel.Value(), newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_operationalStateID; + std::string value_operationalStateIDClassName = "java/lang/Integer"; + std::string value_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_operationalStateIDClassName.c_str(), + value_operationalStateIDCtorSignature.c_str(), + cppValue.operationalStateID, value_operationalStateID); + jobject value_operationalStateLabel; + if (!cppValue.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_operationalStateLabel); + } + else + { + jobject value_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.operationalStateLabel.Value(), + value_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_operationalStateLabelInsideOptional, + value_operationalStateLabel); + } + + jclass operationalStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + return nullptr; + } + jmethodID operationalStateStructStructCtor_0 = + env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(operationalStateStructStructClass_0, operationalStateStructStructCtor_0, + value_operationalStateID, value_operationalStateLabel); + return value; + } + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_errorStateID; + std::string value_errorStateIDClassName = "java/lang/Integer"; + std::string value_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_errorStateIDClassName.c_str(), + value_errorStateIDCtorSignature.c_str(), + cppValue.errorStateID, value_errorStateID); + jobject value_errorStateLabel; + if (!cppValue.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateLabel); + } + else + { + jobject value_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateLabel.Value(), + value_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateLabelInsideOptional, value_errorStateLabel); + } + jobject value_errorStateDetails; + if (!cppValue.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorStateDetails); + } + else + { + jobject value_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorStateDetails.Value(), + value_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::HepaFilterMonitoring::Id: { using namespace app::Clusters::HepaFilterMonitoring; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index b7537c2e38ad24..0c5b959a478e20 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -594,6 +594,20 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 03ebc2ef9083f4..79f848d427a08b 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2883,16 +2883,19 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & std::string value_errorState_errorStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( value_errorState_errorStateIDClassName.c_str(), value_errorState_errorStateIDCtorSignature.c_str(), - static_cast(cppValue.errorState.errorStateID), value_errorState_errorStateID); + cppValue.errorState.errorStateID, value_errorState_errorStateID); jobject value_errorState_errorStateLabel; - if (cppValue.errorState.errorStateLabel.IsNull()) + if (!cppValue.errorState.errorStateLabel.HasValue()) { - value_errorState_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateLabel); } else { - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.errorState.errorStateLabel.Value(), - value_errorState_errorStateLabel)); + jobject value_errorState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateLabel.Value(), value_errorState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateLabelInsideOptional, + value_errorState_errorStateLabel); } jobject value_errorState_errorStateDetails; if (!cppValue.errorState.errorStateDetails.HasValue()) @@ -2917,7 +2920,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( - errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -2960,9 +2963,9 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jobject value_completionErrorCode; std::string value_completionErrorCodeClassName = "java/lang/Integer"; std::string value_completionErrorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_completionErrorCodeClassName.c_str(), value_completionErrorCodeCtorSignature.c_str(), - static_cast(cppValue.completionErrorCode), value_completionErrorCode); + chip::JniReferences::GetInstance().CreateBoxedObject(value_completionErrorCodeClassName.c_str(), + value_completionErrorCodeCtorSignature.c_str(), + cppValue.completionErrorCode, value_completionErrorCode); jobject value_totalOperationalTime; if (!cppValue.totalOperationalTime.HasValue()) @@ -3040,6 +3043,189 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::RoboticVacuumOperationalState::Id: { + using namespace app::Clusters::RoboticVacuumOperationalState; + switch (aPath.mEventId) + { + case Events::OperationalError::Id: { + Events::OperationalError::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_errorState; + jobject value_errorState_errorStateID; + std::string value_errorState_errorStateIDClassName = "java/lang/Integer"; + std::string value_errorState_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_errorState_errorStateIDClassName.c_str(), value_errorState_errorStateIDCtorSignature.c_str(), + cppValue.errorState.errorStateID, value_errorState_errorStateID); + jobject value_errorState_errorStateLabel; + if (!cppValue.errorState.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateLabel); + } + else + { + jobject value_errorState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateLabel.Value(), value_errorState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateLabelInsideOptional, + value_errorState_errorStateLabel); + } + jobject value_errorState_errorStateDetails; + if (!cppValue.errorState.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_errorState_errorStateDetails); + } + else + { + jobject value_errorState_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + cppValue.errorState.errorStateDetails.Value(), value_errorState_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_errorState_errorStateDetailsInsideOptional, + value_errorState_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + return nullptr; + } + jmethodID errorStateStructStructCtor_0 = env->GetMethodID( + errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } + + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + + jclass operationalErrorStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent", + operationalErrorStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent"); + return nullptr; + } + jmethodID operationalErrorStructCtor = + env->GetMethodID(operationalErrorStructClass, "", + "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V"); + if (operationalErrorStructCtor == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(operationalErrorStructClass, operationalErrorStructCtor, value_errorState); + + return value; + } + case Events::OperationCompletion::Id: { + Events::OperationCompletion::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_completionErrorCode; + std::string value_completionErrorCodeClassName = "java/lang/Integer"; + std::string value_completionErrorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_completionErrorCodeClassName.c_str(), + value_completionErrorCodeCtorSignature.c_str(), + cppValue.completionErrorCode, value_completionErrorCode); + + jobject value_totalOperationalTime; + if (!cppValue.totalOperationalTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_totalOperationalTime); + } + else + { + jobject value_totalOperationalTimeInsideOptional; + if (cppValue.totalOperationalTime.Value().IsNull()) + { + value_totalOperationalTimeInsideOptional = nullptr; + } + else + { + std::string value_totalOperationalTimeInsideOptionalClassName = "java/lang/Long"; + std::string value_totalOperationalTimeInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_totalOperationalTimeInsideOptionalClassName.c_str(), + value_totalOperationalTimeInsideOptionalCtorSignature.c_str(), + cppValue.totalOperationalTime.Value().Value(), value_totalOperationalTimeInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_totalOperationalTimeInsideOptional, + value_totalOperationalTime); + } + + jobject value_pausedTime; + if (!cppValue.pausedTime.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_pausedTime); + } + else + { + jobject value_pausedTimeInsideOptional; + if (cppValue.pausedTime.Value().IsNull()) + { + value_pausedTimeInsideOptional = nullptr; + } + else + { + std::string value_pausedTimeInsideOptionalClassName = "java/lang/Long"; + std::string value_pausedTimeInsideOptionalCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_pausedTimeInsideOptionalClassName.c_str(), value_pausedTimeInsideOptionalCtorSignature.c_str(), + cppValue.pausedTime.Value().Value(), value_pausedTimeInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_pausedTimeInsideOptional, value_pausedTime); + } + + jclass operationCompletionStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent", + operationCompletionStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent"); + return nullptr; + } + jmethodID operationCompletionStructCtor = env->GetMethodID( + operationCompletionStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (operationCompletionStructCtor == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(operationCompletionStructClass, operationCompletionStructCtor, value_completionErrorCode, + value_totalOperationalTime, value_pausedTime); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::HepaFilterMonitoring::Id: { using namespace app::Clusters::HepaFilterMonitoring; switch (aPath.mEventId) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index dacb197027abec..1b889b3567489d 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3322,16 +3322,19 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( std::string CommandResponseState_errorStateIDCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( CommandResponseState_errorStateIDClassName.c_str(), CommandResponseState_errorStateIDCtorSignature.c_str(), - static_cast(dataResponse.commandResponseState.errorStateID), CommandResponseState_errorStateID); + dataResponse.commandResponseState.errorStateID, CommandResponseState_errorStateID); jobject CommandResponseState_errorStateLabel; - if (dataResponse.commandResponseState.errorStateLabel.IsNull()) + if (!dataResponse.commandResponseState.errorStateLabel.HasValue()) { - CommandResponseState_errorStateLabel = nullptr; + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateLabel); } else { + jobject CommandResponseState_errorStateLabelInsideOptional; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( - dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabel)); + dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateLabelInsideOptional, + CommandResponseState_errorStateLabel); } jobject CommandResponseState_errorStateDetails; if (!dataResponse.commandResponseState.errorStateDetails.HasValue()) @@ -3356,7 +3359,7 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( return; } jmethodID errorStateStructStructCtor_0 = - env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;Ljava/util/Optional;)V"); + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); @@ -3369,6 +3372,120 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); } +CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: + CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod( + env, javaCallbackRef, "onSuccess", + "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject CommandResponseState; + jobject CommandResponseState_errorStateID; + std::string CommandResponseState_errorStateIDClassName = "java/lang/Integer"; + std::string CommandResponseState_errorStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + CommandResponseState_errorStateIDClassName.c_str(), CommandResponseState_errorStateIDCtorSignature.c_str(), + dataResponse.commandResponseState.errorStateID, CommandResponseState_errorStateID); + jobject CommandResponseState_errorStateLabel; + if (!dataResponse.commandResponseState.errorStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateLabel); + } + else + { + jobject CommandResponseState_errorStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateLabel.Value(), CommandResponseState_errorStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateLabelInsideOptional, + CommandResponseState_errorStateLabel); + } + jobject CommandResponseState_errorStateDetails; + if (!dataResponse.commandResponseState.errorStateDetails.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, CommandResponseState_errorStateDetails); + } + else + { + jobject CommandResponseState_errorStateDetailsInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + dataResponse.commandResponseState.errorStateDetails.Value(), CommandResponseState_errorStateDetailsInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(CommandResponseState_errorStateDetailsInsideOptional, + CommandResponseState_errorStateDetails); + } + + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + return; + } + jmethodID errorStateStructStructCtor_0 = + env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); + if (errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + return; + } + + CommandResponseState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, CommandResponseState_errorStateID, + CommandResponseState_errorStateLabel, CommandResponseState_errorStateDetails); + + env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); +} CHIPDoorLockClusterGetWeekDayScheduleResponseCallback::CHIPDoorLockClusterGetWeekDayScheduleResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 585195f541e966..c838d0e129b262 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -571,6 +571,22 @@ class CHIPOperationalStateClusterOperationalCommandResponseCallback jobject javaCallbackRef; }; +class CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback +{ +public: + CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); + + ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(); + + static void CallbackFn( + void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPDoorLockClusterGetWeekDayScheduleResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 23be9ec0902b8f..fcc2f44b7a1f5e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -25127,12 +25127,22 @@ void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( jobject newElement_0_operationalStateID; std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_operationalStateIDClassName.c_str(), newElement_0_operationalStateIDCtorSignature.c_str(), - static_cast(entry_0.operationalStateID), newElement_0_operationalStateID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_operationalStateIDClassName.c_str(), + newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); jobject newElement_0_operationalStateLabel; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel, newElement_0_operationalStateLabel)); + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel.Value(), + newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( @@ -25144,7 +25154,7 @@ void CHIPOperationalStateOperationalStateListAttributeCallback::CallbackFn( return; } jmethodID operationalStateStructStructCtor_1 = - env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); @@ -25444,6 +25454,610 @@ void CHIPOperationalStateAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::~CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + if (list.IsNull()) + { + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) + { + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1, newElement_1)); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::~CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::~CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: + CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: + ~CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_operationalStateID; + std::string newElement_0_operationalStateIDClassName = "java/lang/Integer"; + std::string newElement_0_operationalStateIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_operationalStateIDClassName.c_str(), + newElement_0_operationalStateIDCtorSignature.c_str(), + entry_0.operationalStateID, newElement_0_operationalStateID); + jobject newElement_0_operationalStateLabel; + if (!entry_0.operationalStateLabel.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_operationalStateLabel); + } + else + { + jobject newElement_0_operationalStateLabelInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.operationalStateLabel.Value(), + newElement_0_operationalStateLabelInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_operationalStateLabelInsideOptional, + newElement_0_operationalStateLabel); + } + + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + return; + } + jmethodID operationalStateStructStructCtor_1 = + env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); + if (operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + return; + } + + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: + CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: + ~CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: + CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: + ~CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CHIPRoboticVacuumOperationalStateEventListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateEventListAttributeCallback::~CHIPRoboticVacuumOperationalStateEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::~CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPHepaFilterMonitoringGeneratedCommandListAttributeCallback::CHIPHepaFilterMonitoringGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index f9aca55fe803e6..c47f7a1cdd6770 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -16780,6 +16780,310 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } + public static class RoboticVacuumOperationalStateCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 97L; + + public RoboticVacuumOperationalStateCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void pause(OperationalCommandResponseCallback callback + ) { + pause(chipClusterPtr, callback, null); + } + + public void pause(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + pause(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void stop(OperationalCommandResponseCallback callback + ) { + stop(chipClusterPtr, callback, null); + } + + public void stop(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + stop(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void start(OperationalCommandResponseCallback callback + ) { + start(chipClusterPtr, callback, null); + } + + public void start(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + start(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void resume(OperationalCommandResponseCallback callback + ) { + resume(chipClusterPtr, callback, null); + } + + public void resume(OperationalCommandResponseCallback callback + + , int timedInvokeTimeoutMs) { + resume(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + private native void pause(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void stop(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void start(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void resume(long chipClusterPtr, OperationalCommandResponseCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + public interface OperationalCommandResponseCallback { + void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct commandResponseState); + + void onError(Exception error); + } + + + public interface PhaseListAttributeCallback { + void onSuccess(@Nullable List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface CurrentPhaseAttributeCallback { + void onSuccess(@Nullable Integer value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface CountdownTimeAttributeCallback { + void onSuccess(@Nullable Long value); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface OperationalStateListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AcceptedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface EventListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AttributeListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readPhaseListAttribute( + PhaseListAttributeCallback callback + ) { + readPhaseListAttribute(chipClusterPtr, callback); + } + public void subscribePhaseListAttribute( + PhaseListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribePhaseListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentPhaseAttribute( + CurrentPhaseAttributeCallback callback + ) { + readCurrentPhaseAttribute(chipClusterPtr, callback); + } + public void subscribeCurrentPhaseAttribute( + CurrentPhaseAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeCurrentPhaseAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCountdownTimeAttribute( + CountdownTimeAttributeCallback callback + ) { + readCountdownTimeAttribute(chipClusterPtr, callback); + } + public void subscribeCountdownTimeAttribute( + CountdownTimeAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeCountdownTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readOperationalStateListAttribute( + OperationalStateListAttributeCallback callback + ) { + readOperationalStateListAttribute(chipClusterPtr, callback); + } + public void subscribeOperationalStateListAttribute( + OperationalStateListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeOperationalStateListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + ) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + ) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback + ) { + readEventListAttribute(chipClusterPtr, callback); + } + public void subscribeEventListAttribute( + EventListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback + ) { + readAttributeListAttribute(chipClusterPtr, callback); + } + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback + ) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback + ) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readPhaseListAttribute(long chipClusterPtr, + PhaseListAttributeCallback callback + ); + private native void subscribePhaseListAttribute(long chipClusterPtr, + PhaseListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readCurrentPhaseAttribute(long chipClusterPtr, + CurrentPhaseAttributeCallback callback + ); + private native void subscribeCurrentPhaseAttribute(long chipClusterPtr, + CurrentPhaseAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readCountdownTimeAttribute(long chipClusterPtr, + CountdownTimeAttributeCallback callback + ); + private native void subscribeCountdownTimeAttribute(long chipClusterPtr, + CountdownTimeAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readOperationalStateListAttribute(long chipClusterPtr, + OperationalStateListAttributeCallback callback + ); + private native void subscribeOperationalStateListAttribute(long chipClusterPtr, + OperationalStateListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + ); + private native void subscribeGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + ); + private native void subscribeAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + ); + private native void subscribeEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + ); + private native void subscribeAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback + ); + private native void subscribeFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback +, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback + ); + private native void subscribeClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback +, int minInterval, int maxInterval); + } + public static class HepaFilterMonitoringCluster extends BaseChipCluster { public static final long CLUSTER_ID = 113L; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 5141fbb60aa041..acbf63d6f4c4e2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -1305,6 +1305,60 @@ public String toString() { } } +public static class RoboticVacuumOperationalStateClusterOperationalErrorEvent { +public ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState; + + public RoboticVacuumOperationalStateClusterOperationalErrorEvent( + ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState + ) { + this.errorState = errorState; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterOperationalErrorEvent {\n"); + output.append("\terrorState: "); + output.append(errorState); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + +public static class RoboticVacuumOperationalStateClusterOperationCompletionEvent { +public Integer completionErrorCode; +public @Nullable Optional totalOperationalTime; +public @Nullable Optional pausedTime; + + public RoboticVacuumOperationalStateClusterOperationCompletionEvent( + Integer completionErrorCode + , @Nullable Optional totalOperationalTime + , @Nullable Optional pausedTime + ) { + this.completionErrorCode = completionErrorCode; + this.totalOperationalTime = totalOperationalTime; + this.pausedTime = pausedTime; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterOperationCompletionEvent {\n"); + output.append("\tcompletionErrorCode: "); + output.append(completionErrorCode); + output.append("\n"); + output.append("\ttotalOperationalTime: "); + output.append(totalOperationalTime); + output.append("\n"); + output.append("\tpausedTime: "); + output.append(pausedTime); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + public static class DoorLockClusterDoorLockAlarmEvent { public Integer alarmCode; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 83e7e60c2e79ea..1691df2f2bd8ee 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -183,6 +183,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 96L) { return "OperationalState"; } + if (clusterId == 97L) { + return "RoboticVacuumOperationalState"; + } if (clusterId == 113L) { return "HepaFilterMonitoring"; } @@ -2570,6 +2573,45 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 97L) { + if (attributeId == 0L) { + return "PhaseList"; + } + if (attributeId == 1L) { + return "CurrentPhase"; + } + if (attributeId == 2L) { + return "CountdownTime"; + } + if (attributeId == 3L) { + return "OperationalStateList"; + } + if (attributeId == 4L) { + return "OperationalState"; + } + if (attributeId == 5L) { + return "OperationalError"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 113L) { if (attributeId == 0L) { return "Condition"; @@ -7366,6 +7408,15 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 97L) { + if (eventId == 0L) { + return "OperationalError"; + } + if (eventId == 1L) { + return "OperationCompletion"; + } + return ""; + } if (clusterId == 113L) { return ""; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index b5294f94e6054b..e7aff346222b4a 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1940,12 +1940,12 @@ public String toString() { public static class OperationalStateClusterErrorStateStruct { public Integer errorStateID; -public @Nullable String errorStateLabel; +public Optional errorStateLabel; public Optional errorStateDetails; public OperationalStateClusterErrorStateStruct( Integer errorStateID - , @Nullable String errorStateLabel + , Optional errorStateLabel , Optional errorStateDetails ) { this.errorStateID = errorStateID; @@ -1973,11 +1973,11 @@ public String toString() { public static class OperationalStateClusterOperationalStateStruct { public Integer operationalStateID; -public String operationalStateLabel; +public Optional operationalStateLabel; public OperationalStateClusterOperationalStateStruct( Integer operationalStateID - , String operationalStateLabel + , Optional operationalStateLabel ) { this.operationalStateID = operationalStateID; this.operationalStateLabel = operationalStateLabel; @@ -1998,6 +1998,66 @@ public String toString() { } } +public static class RoboticVacuumOperationalStateClusterErrorStateStruct { +public Integer errorStateID; +public Optional errorStateLabel; +public Optional errorStateDetails; + + public RoboticVacuumOperationalStateClusterErrorStateStruct( + Integer errorStateID + , Optional errorStateLabel + , Optional errorStateDetails + ) { + this.errorStateID = errorStateID; + this.errorStateLabel = errorStateLabel; + this.errorStateDetails = errorStateDetails; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterErrorStateStruct {\n"); + output.append("\terrorStateID: "); + output.append(errorStateID); + output.append("\n"); + output.append("\terrorStateLabel: "); + output.append(errorStateLabel); + output.append("\n"); + output.append("\terrorStateDetails: "); + output.append(errorStateDetails); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + +public static class RoboticVacuumOperationalStateClusterOperationalStateStruct { +public Integer operationalStateID; +public Optional operationalStateLabel; + + public RoboticVacuumOperationalStateClusterOperationalStateStruct( + Integer operationalStateID + , Optional operationalStateLabel + ) { + this.operationalStateID = operationalStateID; + this.operationalStateLabel = operationalStateLabel; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("RoboticVacuumOperationalStateClusterOperationalStateStruct {\n"); + output.append("\toperationalStateID: "); + output.append(operationalStateID); + output.append("\n"); + output.append("\toperationalStateLabel: "); + output.append(operationalStateLabel); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} + public static class DoorLockClusterCredentialStruct { public Integer credentialType; public Integer credentialIndex; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 92f7fa0d6f7645..71d7a62f7ecf6f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7319,6 +7319,180 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { this.callback = callback; } +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct CommandResponseState) { + Map responseValues = new LinkedHashMap<>(); + // CommandResponseState: Struct ErrorStateStruct + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + @Override public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); @@ -19852,6 +20026,9 @@ public Map initializeClusterMap() { ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); + ClusterInfo roboticVacuumOperationalStateClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RoboticVacuumOperationalStateCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInfo); ClusterInfo hepaFilterMonitoringClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.HepaFilterMonitoringCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInfo); @@ -20143,6 +20320,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); + Map roboticVacuumOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + Map roboticVacuumOperationalStatepauseCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStatepauseInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .pause((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStatepauseCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("pause", roboticVacuumOperationalStatepauseInteractionInfo); + Map roboticVacuumOperationalStatestopCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStatestopInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .stop((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStatestopCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("stop", roboticVacuumOperationalStatestopInteractionInfo); + Map roboticVacuumOperationalStatestartCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStatestartInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .start((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStatestartCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("start", roboticVacuumOperationalStatestartInteractionInfo); + Map roboticVacuumOperationalStateresumeCommandParams = new LinkedHashMap(); + InteractionInfo roboticVacuumOperationalStateresumeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) + .resume((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + + ); + }, + () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), + roboticVacuumOperationalStateresumeCommandParams + ); + roboticVacuumOperationalStateClusterInteractionInfoMap.put("resume", roboticVacuumOperationalStateresumeInteractionInfo); + commandMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInteractionInfoMap); Map hepaFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInteractionInfoMap); Map activatedCarbonFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index d65219839e0887..3a561178d48930 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -5305,6 +5305,110 @@ class ChipClusters: }, }, } + _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO = { + "clusterName": "RoboticVacuumOperationalState", + "clusterId": 0x00000061, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Pause", + "args": { + }, + }, + 0x00000001: { + "commandId": 0x00000001, + "commandName": "Stop", + "args": { + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "Start", + "args": { + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "Resume", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "PhaseList", + "attributeId": 0x00000000, + "type": "str", + "reportable": True, + }, + 0x00000001: { + "attributeName": "CurrentPhase", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "CountdownTime", + "attributeId": 0x00000002, + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "OperationalStateList", + "attributeId": 0x00000003, + "type": "", + "reportable": True, + }, + 0x00000004: { + "attributeName": "OperationalState", + "attributeId": 0x00000004, + "type": "", + "reportable": True, + }, + 0x00000005: { + "attributeName": "OperationalError", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _HEPA_FILTER_MONITORING_CLUSTER_INFO = { "clusterName": "HepaFilterMonitoring", "clusterId": 0x00000071, @@ -15591,6 +15695,7 @@ class ChipClusters: 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, + 0x00000061: _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, 0x00000072: _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, 0x00000073: _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, @@ -15725,6 +15830,7 @@ class ChipClusters: "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, + "RoboticVacuumOperationalState": _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, "ActivatedCarbonFilterMonitoring": _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, "CeramicFilterMonitoring": _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 06be17d6c5a97d..2f9c0c0bc7ac56 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18235,13 +18235,13 @@ class ErrorStateStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), - ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Union[Nullable, str]), + ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="errorStateDetails", Tag=2, Type=typing.Optional[str]), ]) - errorStateID: 'OperationalState.Enums.ErrorStateEnum' = 0 - errorStateLabel: 'typing.Union[Nullable, str]' = NullValue + errorStateID: 'uint' = 0 + errorStateLabel: 'typing.Optional[str]' = None errorStateDetails: 'typing.Optional[str]' = None @dataclass @@ -18250,12 +18250,12 @@ class OperationalStateStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=OperationalState.Enums.OperationalStateEnum), - ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=typing.Optional[str]), ]) - operationalStateID: 'OperationalState.Enums.OperationalStateEnum' = 0 - operationalStateLabel: 'str' = "" + operationalStateID: 'uint' = 0 + operationalStateLabel: 'typing.Optional[str]' = None class Commands: @dataclass @@ -18553,12 +18553,408 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=OperationalState.Enums.ErrorStateEnum), + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="totalOperationalTime", Tag=1, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="pausedTime", Tag=2, Type=typing.Union[None, Nullable, uint]), ]) - completionErrorCode: 'OperationalState.Enums.ErrorStateEnum' = 0 + completionErrorCode: 'uint' = 0 + totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None + pausedTime: 'typing.Union[None, Nullable, uint]' = None + + +@dataclass +class RoboticVacuumOperationalState(Cluster): + id: typing.ClassVar[int] = 0x0061 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="phaseList", Tag=0x00000000, Type=typing.Union[Nullable, typing.List[str]]), + ClusterObjectFieldDescriptor(Label="currentPhase", Tag=0x00000001, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="countdownTime", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="operationalStateList", Tag=0x00000003, Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]), + ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct), + ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + phaseList: 'typing.Union[Nullable, typing.List[str]]' = None + currentPhase: 'typing.Union[Nullable, uint]' = None + countdownTime: 'typing.Union[None, Nullable, uint]' = None + operationalStateList: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = None + operationalState: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = None + operationalError: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class ErrorStateEnum(MatterIntEnum): + kFailedToFindChargingDock = 0x40 + kStuck = 0x41 + kDustBinMissing = 0x42 + kDustBinFull = 0x43 + kWaterTankEmpty = 0x44 + kWaterTankMissing = 0x45 + kWaterTankLidOpen = 0x46 + kMopCleaningPadMissing = 0x47 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, + + class OperationalStateEnum(MatterIntEnum): + kSeekingCharger = 0x40 + kCharging = 0x41 + kDocked = 0x42 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, + + class Structs: + @dataclass + class ErrorStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="errorStateLabel", Tag=1, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="errorStateDetails", Tag=2, Type=typing.Optional[str]), + ]) + + errorStateID: 'uint' = 0 + errorStateLabel: 'typing.Optional[str]' = None + errorStateDetails: 'typing.Optional[str]' = None + + @dataclass + class OperationalStateStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="operationalStateID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="operationalStateLabel", Tag=1, Type=typing.Optional[str]), + ]) + + operationalStateID: 'uint' = 0 + operationalStateLabel: 'typing.Optional[str]' = None + + class Commands: + @dataclass + class Pause(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Stop(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Start(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class Resume(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'OperationalCommandResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class OperationalCommandResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0061 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ]) + + commandResponseState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + + class Attributes: + @dataclass + class PhaseList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, typing.List[str]]) + + value: 'typing.Union[Nullable, typing.List[str]]' = NullValue + + @dataclass + class CurrentPhase(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + + @dataclass + class CountdownTime(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + + value: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class OperationalStateList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]) + + value: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) + + @dataclass + class OperationalState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct) + + value: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.OperationalStateStruct()) + + @dataclass + class OperationalError(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct) + + value: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class OperationalError(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ]) + + errorState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + + @dataclass + class OperationCompletion(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0061 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="completionErrorCode", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="totalOperationalTime", Tag=1, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="pausedTime", Tag=2, Type=typing.Union[None, Nullable, uint]), + ]) + + completionErrorCode: 'uint' = 0 totalOperationalTime: 'typing.Union[None, Nullable, uint]' = None pausedTime: 'typing.Union[None, Nullable, uint]' = None diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 0920c65ca69499..ca5f6de6d4d508 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2018,6 +2018,51 @@ static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttribute } } } +static BOOL AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(AttributeId aAttributeId) +{ + using namespace Clusters::RoboticVacuumOperationalState; + switch (aAttributeId) { + case Attributes::PhaseList::Id: { + return YES; + } + case Attributes::CurrentPhase::Id: { + return YES; + } + case Attributes::CountdownTime::Id: { + return YES; + } + case Attributes::OperationalStateList::Id: { + return YES; + } + case Attributes::OperationalState::Id: { + return YES; + } + case Attributes::OperationalError::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInHEPAFilterMonitoringCluster(AttributeId aAttributeId) { using namespace Clusters::HepaFilterMonitoring; @@ -5100,6 +5145,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } + case Clusters::RoboticVacuumOperationalState::Id: { + return AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(aAttributeId); + } case Clusters::HepaFilterMonitoring::Id: { return AttributeIsSpecifiedInHEPAFilterMonitoringCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4d7cbd75eab3d6..a5635f62e1e325 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10146,12 +10146,16 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( auto & entry_0 = iter_0.GetValue(); MTROperationalStateClusterOperationalStateStruct * newElement_0; newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; } [array_0 addObject:newElement_0]; } @@ -10173,12 +10177,16 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } MTROperationalStateClusterOperationalStateStruct * _Nonnull value; value = [MTROperationalStateClusterOperationalStateStruct new]; - value.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.operationalStateID)]; - value.operationalStateLabel = AsString(cppValue.operationalStateLabel); - if (value.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; + if (cppValue.operationalStateLabel.HasValue()) { + value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); + if (value.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.operationalStateLabel = nil; } return value; } @@ -10191,16 +10199,311 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } MTROperationalStateClusterErrorStateStruct * _Nonnull value; value = [MTROperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorStateID)]; - if (cppValue.errorStateLabel.IsNull()) { + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { value.errorStateLabel = nil; + } + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateDetails = nil; + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RoboticVacuumOperationalState; + switch (aAttributeId) { + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } + return value; + } + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull value; + value = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; + if (cppValue.operationalStateLabel.HasValue()) { + value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); + if (value.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.operationalStateLabel = nil; + } + return value; + } + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); if (value.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } + } else { + value.errorStateLabel = nil; } if (cppValue.errorStateDetails.HasValue()) { value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); @@ -24288,6 +24591,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::RoboticVacuumOperationalState::Id: { + return DecodeAttributeValueForRoboticVacuumOperationalStateCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::HepaFilterMonitoring::Id: { return DecodeAttributeValueForHEPAFilterMonitoringCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 599499f005e8a3..6a8ead093b0344 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8736,6 +8736,220 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Robotic Vacuum Operational State + * + * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + */ +MTR_NEWLY_AVAILABLE +@interface MTRBaseClusterRoboticVacuumOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +/** + * Command Pause + * + * Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. + */ +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Stop + * + * Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. + */ +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Start + * + * Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it + * can be started. + */ +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +/** + * Command Resume + * + * Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the + * point when it was paused by means outside of this cluster (for example by manual button press). + */ +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalStateWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void) + readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeOperationalErrorWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_NEWLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_NEWLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster HEPA Filter Monitoring * @@ -24439,6 +24653,23 @@ typedef NS_ENUM(uint8_t, MTROperationalState) { MTROperationalStateError MTR_NEWLY_AVAILABLE = 0x03, } MTR_NEWLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateErrorState) { + MTRRoboticVacuumOperationalStateErrorStateFailedToFindChargingDock MTR_NEWLY_AVAILABLE = 0x40, + MTRRoboticVacuumOperationalStateErrorStateStuck MTR_NEWLY_AVAILABLE = 0x41, + MTRRoboticVacuumOperationalStateErrorStateDustBinMissing MTR_NEWLY_AVAILABLE = 0x42, + MTRRoboticVacuumOperationalStateErrorStateDustBinFull MTR_NEWLY_AVAILABLE = 0x43, + MTRRoboticVacuumOperationalStateErrorStateWaterTankEmpty MTR_NEWLY_AVAILABLE = 0x44, + MTRRoboticVacuumOperationalStateErrorStateWaterTankMissing MTR_NEWLY_AVAILABLE = 0x45, + MTRRoboticVacuumOperationalStateErrorStateWaterTankLidOpen MTR_NEWLY_AVAILABLE = 0x46, + MTRRoboticVacuumOperationalStateErrorStateMopCleaningPadMissing MTR_NEWLY_AVAILABLE = 0x47, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateOperationalState) { + MTRRoboticVacuumOperationalStateOperationalStateSeekingCharger MTR_NEWLY_AVAILABLE = 0x40, + MTRRoboticVacuumOperationalStateOperationalStateCharging MTR_NEWLY_AVAILABLE = 0x41, + MTRRoboticVacuumOperationalStateOperationalStateDocked MTR_NEWLY_AVAILABLE = 0x42, +} MTR_NEWLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringChangeIndication) { MTRHEPAFilterMonitoringChangeIndicationOK MTR_NEWLY_AVAILABLE = 0x00, MTRHEPAFilterMonitoringChangeIndicationWarning MTR_NEWLY_AVAILABLE = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index cdf9f56791411a..087572b6978dba 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50705,6 +50705,730 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterRoboticVacuumOperationalState + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + _endpoint = [endpointID unsignedShortValue]; + } + return self; +} + +- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil completion:completion]; +} +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Pause::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil completion:completion]; +} +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Stop::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil completion:completion]; +} +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Start::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil completion:completion]; +} +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, + completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Resume::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalStateWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, + reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void) + readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeOperationalErrorWithCompletion: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, + reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)( + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(RoboticVacuumOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +@end + @implementation MTRBaseClusterHEPAFilterMonitoring - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 1063a353250da9..aa29354560fb44 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -225,6 +225,11 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end +@interface MTRBaseClusterRoboticVacuumOperationalState () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@property (nonatomic, assign, readonly) chip::EndpointId endpoint; +@end + @interface MTRBaseClusterHEPAFilterMonitoring () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index e239e1f9d503eb..df099251b0729e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -87,6 +87,8 @@ typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); typedef void (*OperationalStateClusterOperationalCommandResponseCallbackType)( void *, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &); +typedef void (*RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType)( + void *, const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -414,6 +416,14 @@ typedef void (*OperationalStateClusterOperationalStateEnumAttributeCallback)( void *, chip::app::Clusters::OperationalState::OperationalStateEnum); typedef void (*NullableOperationalStateClusterOperationalStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*RoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum); +typedef void (*NullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*RoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum); +typedef void (*NullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*HEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( void *, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum); typedef void (*NullableHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( @@ -1221,6 +1231,24 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( + void * context, const chip::app::DataModel::Nullable> & data); +typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RoboticVacuumOperationalStateOperationalStateStructAttributeCallback)( + void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &); +typedef void (*RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback)( + void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &); +typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringAcceptedCommandListListAttributeCallback)( @@ -9591,6 +9619,286 @@ class MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value); +}; + +class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value); +}; + +class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value); +}; + +class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { @@ -16764,6 +17072,25 @@ class MTROperationalStateClusterOperationalCommandResponseCallbackBridge const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; +class MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, + OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn( + void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); +}; + class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge : public MTRCallbackBridge { @@ -22345,6 +22672,154 @@ class MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSub MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value); +}; + +class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, + OnSuccessFn){}; + + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value); +}; + +class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, + OnSuccessFn){}; + + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::Nullable & value); +}; + +class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +{ +public: + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 41a77955b9d517..1293afafc039f6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -8965,12 +8965,16 @@ auto & entry_0 = iter_0.GetValue(); MTROperationalStateClusterOperationalStateStruct * newElement_0; newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.operationalStateID)]; - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - OnFailureFn(context, err); - return; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + newElement_0.operationalStateLabel = nil; } [array_0 addObject:newElement_0]; } @@ -9004,12 +9008,16 @@ { MTROperationalStateClusterOperationalStateStruct * _Nonnull objCValue; objCValue = [MTROperationalStateClusterOperationalStateStruct new]; - objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.operationalStateID)]; - objCValue.operationalStateLabel = AsString(value.operationalStateLabel); - if (objCValue.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - OnFailureFn(context, err); - return; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; + if (value.operationalStateLabel.HasValue()) { + objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); + if (objCValue.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.operationalStateLabel = nil; } DispatchSuccess(context, objCValue); }; @@ -9034,16 +9042,16 @@ { MTROperationalStateClusterErrorStateStruct * _Nonnull objCValue; objCValue = [MTROperationalStateClusterErrorStateStruct new]; - objCValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.errorStateID)]; - if (value.errorStateLabel.IsNull()) { - objCValue.errorStateLabel = nil; - } else { + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; + if (value.errorStateLabel.HasValue()) { objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); if (objCValue.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; OnFailureFn(context, err); return; } + } else { + objCValue.errorStateLabel = nil; } if (value.errorStateDetails.HasValue()) { objCValue.errorStateDetails = AsString(value.errorStateDetails.Value()); @@ -9225,6 +9233,333 @@ } } +void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSArray * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = value.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_1; + } + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value) +{ + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; + objCValue = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; + if (value.operationalStateLabel.HasValue()) { + objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); + if (objCValue.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.operationalStateLabel = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value) +{ + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull objCValue; + objCValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; + if (value.errorStateLabel.HasValue()) { + objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); + if (objCValue.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.errorStateLabel = nil; + } + if (value.errorStateDetails.HasValue()) { + objCValue.errorStateDetails = AsString(value.errorStateDetails.Value()); + if (objCValue.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + OnFailureFn(context, err); + return; + } + } else { + objCValue.errorStateDetails = nil; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRHEPAFilterMonitoringGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -17409,6 +17744,18 @@ DispatchSuccess(context, response); }; +void MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn(void * context, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data) +{ + auto * response = [MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams new]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + DispatchSuccess(context, response); +}; + void MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) { @@ -21480,6 +21827,107 @@ } } +void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge:: + OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 0e06ba47e07b3f..e92763b74e85bb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -281,6 +281,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000060, + MTRClusterIDTypeRoboticVacuumOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000061, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeDoorLockID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000101, @@ -3825,6 +3826,26 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster RoboticVacuumOperationalState attributes + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster HEPAFilterMonitoring attributes MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeConditionID MTR_NEWLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterHEPAFilterMonitoringAttributeDegradationDirectionID MTR_NEWLY_AVAILABLE = 0x00000001, @@ -9276,6 +9297,13 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster RoboticVacuumOperationalState commands + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster HEPAFilterMonitoring commands MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -10425,6 +10453,10 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, MTREventIDTypeClusterOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster RoboticVacuumOperationalState events + MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster DoorLock deprecated event names MTRClusterDoorLockEventDoorLockAlarmID MTR_DEPRECATED("Please use MTREventIDTypeClusterDoorLockEventDoorLockAlarmID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index dcc4a1916f0fe1..5357cdde89d6b1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3056,6 +3056,83 @@ MTR_NEWLY_AVAILABLE @end +/** + * Cluster Robotic Vacuum Operational State + * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. + */ +MTR_NEWLY_AVAILABLE +@interface MTRClusterRoboticVacuumOperationalState : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; + +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + /** * Cluster HEPA Filter Monitoring * Attributes and commands for monitoring HEPA filters in a device diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2f1684e89b3480..006cc041f8adaa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13913,6 +13913,435 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par @end +@implementation MTRClusterRoboticVacuumOperationalState + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithQueue:queue]) { + if (device == nil) { + return nil; + } + + _endpoint = [endpointID unsignedShortValue]; + _device = device; + } + return self; +} + +- (void)pauseWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self pauseWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Pause::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)stopWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self stopWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Stop::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)startWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self startWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Start::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)resumeWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + [self resumeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, + _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge + = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + RoboticVacuumOperationalState::Commands::Resume::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID) + params:params]; +} + +- (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID) + params:params]; +} + +- (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID) + params:params]; +} + +- (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID) + params:params]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device + readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return + [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID) + params:params]; +} + +@end + @implementation MTRClusterHEPAFilterMonitoring - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 8c738156db2ce6..129f5bdc5ad9fc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -226,6 +226,11 @@ @property (nonatomic, readonly) MTRDevice * device; @end +@interface MTRClusterRoboticVacuumOperationalState () +@property (nonatomic, readonly) uint16_t endpoint; +@property (nonatomic, readonly) MTRDevice * device; +@end + @interface MTRClusterHEPAFilterMonitoring () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index c8e9c13f87d418..0cb9be344b6023 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4266,6 +4266,138 @@ MTR_NEWLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterPauseParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterStopParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterStartParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterResumeParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams : NSObject + +@property (nonatomic, copy) + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; + +/** + * Initialize an MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +@end + MTR_NEWLY_AVAILABLE @interface MTRHEPAFilterMonitoringClusterResetConditionParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 2b97a1e5560931..d1d8bfd771ed4c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6691,15 +6691,222 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct: { self.commandResponseState = [MTROperationalStateClusterErrorStateStruct new]; self.commandResponseState.errorStateID = - [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.commandResponseState.errorStateID)]; - if (decodableStruct.commandResponseState.errorStateLabel.IsNull()) { + [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; + if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { + self.commandResponseState.errorStateLabel = AsString(decodableStruct.commandResponseState.errorStateLabel.Value()); + if (self.commandResponseState.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { self.commandResponseState.errorStateLabel = nil; + } + if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { + self.commandResponseState.errorStateDetails = AsString(decodableStruct.commandResponseState.errorStateDetails.Value()); + if (self.commandResponseState.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } } else { + self.commandResponseState.errorStateDetails = nil; + } + } + return CHIP_NO_ERROR; +} +@end +@implementation MTRRoboticVacuumOperationalStateClusterPauseParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterStopParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterStartParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterResumeParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams alloc] init]; + + other.commandResponseState = self.commandResponseState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: commandResponseState:%@; >", NSStringFromClass([self class]), _commandResponseState]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct +{ + { + self.commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + self.commandResponseState.errorStateID = + [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; + if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { self.commandResponseState.errorStateLabel = AsString(decodableStruct.commandResponseState.errorStateLabel.Value()); if (self.commandResponseState.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; return err; } + } else { + self.commandResponseState.errorStateLabel = nil; } if (decodableStruct.commandResponseState.errorStateDetails.HasValue()) { self.commandResponseState.errorStateDetails = AsString(decodableStruct.commandResponseState.errorStateDetails.Value()); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 28f95b18ae822e..f7058c2accf769 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -224,6 +224,14 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &) + decodableStruct; + +@end + @interface MTRDoorLockClusterGetWeekDayScheduleResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index d02da1d9f29b48..28390e012b6421 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1771,16 +1771,110 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI do { MTROperationalStateClusterErrorStateStruct * _Nonnull memberValue; memberValue = [MTROperationalStateClusterErrorStateStruct new]; - memberValue.errorStateID = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.errorState.errorStateID)]; - if (cppValue.errorState.errorStateLabel.IsNull()) { + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; + if (cppValue.errorState.errorStateLabel.HasValue()) { + memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); + if (memberValue.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { memberValue.errorStateLabel = nil; + } + if (cppValue.errorState.errorStateDetails.HasValue()) { + memberValue.errorStateDetails = AsString(cppValue.errorState.errorStateDetails.Value()); + if (memberValue.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + memberValue.errorStateDetails = nil; + } + value.errorState = memberValue; + } while (0); + + return value; + } + case Events::OperationCompletion::Id: { + Events::OperationCompletion::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTROperationalStateClusterOperationCompletionEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.completionErrorCode]; + value.completionErrorCode = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.totalOperationalTime.HasValue()) { + if (cppValue.totalOperationalTime.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.totalOperationalTime.Value().Value()]; + } } else { + memberValue = nil; + } + value.totalOperationalTime = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.pausedTime.HasValue()) { + if (cppValue.pausedTime.Value().IsNull()) { + memberValue = nil; + } else { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.pausedTime.Value().Value()]; + } + } else { + memberValue = nil; + } + value.pausedTime = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} +static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( + EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RoboticVacuumOperationalState; + switch (aEventId) { + case Events::OperationalError::Id: { + Events::OperationalError::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent new]; + + do { + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull memberValue; + memberValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; + if (cppValue.errorState.errorStateLabel.HasValue()) { memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); if (memberValue.errorStateLabel == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } + } else { + memberValue.errorStateLabel = nil; } if (cppValue.errorState.errorStateDetails.HasValue()) { memberValue.errorStateDetails = AsString(cppValue.errorState.errorStateDetails.Value()); @@ -1804,11 +1898,11 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI return nil; } - __auto_type * value = [MTROperationalStateClusterOperationCompletionEvent new]; + __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent new]; do { NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.completionErrorCode)]; + memberValue = [NSNumber numberWithUnsignedChar:cppValue.completionErrorCode]; value.completionErrorCode = memberValue; } while (0); do { @@ -3050,6 +3144,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } + case Clusters::RoboticVacuumOperationalState::Id: { + return DecodeEventPayloadForRoboticVacuumOperationalStateCluster(aPath.mEventId, aReader, aError); + } case Clusters::HepaFilterMonitoring::Id: { return DecodeEventPayloadForHEPAFilterMonitoringCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 2631ce6538c68c..df9df1aa8f266f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -768,7 +768,7 @@ MTR_NEWLY_AVAILABLE MTR_NEWLY_AVAILABLE @interface MTROperationalStateClusterOperationalStateStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nonnull operationalStateLabel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE @@ -783,6 +783,31 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; @end +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterErrorStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull errorStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable errorStateLabel MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable errorStateDetails MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationalStateStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent : NSObject +@property (nonatomic, copy) MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; +@end + +MTR_NEWLY_AVAILABLE +@interface MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull completionErrorCode MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable totalOperationalTime MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; +@end + API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDoorLockClusterCredentialStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull credentialType API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 1cc982890290bd..49c260685ea8d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3027,7 +3027,7 @@ - (instancetype)init _operationalStateID = @(0); - _operationalStateLabel = @""; + _operationalStateLabel = nil; } return self; } @@ -3114,6 +3114,134 @@ - (NSString *)description @end +@implementation MTRRoboticVacuumOperationalStateClusterErrorStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _errorStateID = @(0); + + _errorStateLabel = nil; + + _errorStateDetails = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterErrorStateStruct alloc] init]; + + other.errorStateID = self.errorStateID; + other.errorStateLabel = self.errorStateLabel; + other.errorStateDetails = self.errorStateDetails; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: errorStateID:%@; errorStateLabel:%@; errorStateDetails:%@; >", + NSStringFromClass([self class]), _errorStateID, _errorStateLabel, _errorStateDetails]; + return descriptionString; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationalStateStruct +- (instancetype)init +{ + if (self = [super init]) { + + _operationalStateID = @(0); + + _operationalStateLabel = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalStateStruct alloc] init]; + + other.operationalStateID = self.operationalStateID; + other.operationalStateLabel = self.operationalStateLabel; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: operationalStateID:%@; operationalStateLabel:%@; >", + NSStringFromClass([self class]), _operationalStateID, _operationalStateLabel]; + return descriptionString; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent +- (instancetype)init +{ + if (self = [super init]) { + + _errorState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent alloc] init]; + + other.errorState = self.errorState; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: errorState:%@; >", NSStringFromClass([self class]), _errorState]; + return descriptionString; +} + +@end + +@implementation MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent +- (instancetype)init +{ + if (self = [super init]) { + + _completionErrorCode = @(0); + + _totalOperationalTime = nil; + + _pausedTime = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent alloc] init]; + + other.completionErrorCode = self.completionErrorCode; + other.totalOperationalTime = self.totalOperationalTime; + other.pausedTime = self.pausedTime; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: completionErrorCode:%@; totalOperationalTime:%@; pausedTime:%@; >", + NSStringFromClass([self class]), _completionErrorCode, _totalOperationalTime, _pausedTime]; + return descriptionString; +} + +@end + @implementation MTRDoorLockClusterCredentialStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 7d95541b504db2..25de60374eea9f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -9699,6 +9699,180 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Attributes { + +namespace CurrentPhase { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CurrentPhase + +namespace CountdownTime { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace CountdownTime + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 43bbc64c943f50..cb4e413dc21d55 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1812,6 +1812,36 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Attributes { + +namespace CurrentPhase { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace CurrentPhase + +namespace CountdownTime { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // elapsed_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace CountdownTime + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 5df828f260f298..6fbefcb1aca444 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -457,6 +457,14 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpoint); +/** @brief Robotic Vacuum Operational State Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRoboticVacuumOperationalStateClusterInitCallback(chip::EndpointId endpoint); + /** @brief HEPA Filter Monitoring Cluster Init * * Cluster Init @@ -5171,6 +5179,83 @@ void emberAfOperationalStateClusterServerTickCallback(chip::EndpointId endpoint) */ void emberAfOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); +// +// Robotic Vacuum Operational State Cluster +// + +/** @brief Robotic Vacuum Operational State Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRoboticVacuumOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterRoboticVacuumOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfRoboticVacuumOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterRoboticVacuumOperationalStateClusterServerAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Robotic Vacuum Operational State Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Robotic Vacuum Operational State Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterClientPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Robotic Vacuum Operational State Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRoboticVacuumOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Robotic Vacuum Operational State Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfRoboticVacuumOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); + // // HEPA Filter Monitoring Cluster // @@ -11730,6 +11815,30 @@ bool emberAfOperationalStateClusterStartCallback( bool emberAfOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalState::Commands::Resume::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Pause Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterPauseCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Stop Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterStopCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Start Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterStartCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::DecodableType & commandData); +/** + * @brief Robotic Vacuum Operational State Cluster Resume Command callback (from client) + */ +bool emberAfRoboticVacuumOperationalStateClusterResumeCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::DecodableType & commandData); /** * @brief HEPA Filter Monitoring Cluster ResetCondition Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 843538b9e1e2a3..df5387fba26364 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1500,6 +1500,38 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::Opera } } +static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::ErrorStateEnum val) +{ + using EnumType = RoboticVacuumOperationalState::ErrorStateEnum; + switch (val) + { + case EnumType::kFailedToFindChargingDock: + case EnumType::kStuck: + case EnumType::kDustBinMissing: + case EnumType::kDustBinFull: + case EnumType::kWaterTankEmpty: + case EnumType::kWaterTankMissing: + case EnumType::kWaterTankLidOpen: + case EnumType::kMopCleaningPadMissing: + return val; + default: + return static_cast(0); + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::OperationalStateEnum val) +{ + using EnumType = RoboticVacuumOperationalState::OperationalStateEnum; + switch (val) + { + case EnumType::kSeekingCharger: + case EnumType::kCharging: + case EnumType::kDocked: + return val; + default: + return static_cast(0); + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(HepaFilterMonitoring::ChangeIndicationEnum val) { using EnumType = HepaFilterMonitoring::ChangeIndicationEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 0d755baec83fee..75ef76a7a7ba03 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1835,6 +1835,40 @@ enum class OperationalStateEnum : uint8_t }; } // namespace OperationalState +namespace RoboticVacuumOperationalState { + +// Enum for ErrorStateEnum +enum class ErrorStateEnum : uint8_t +{ + kFailedToFindChargingDock = 0x40, + kStuck = 0x41, + kDustBinMissing = 0x42, + kDustBinFull = 0x43, + kWaterTankEmpty = 0x44, + kWaterTankMissing = 0x45, + kWaterTankLidOpen = 0x46, + kMopCleaningPadMissing = 0x47, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, +}; + +// Enum for OperationalStateEnum +enum class OperationalStateEnum : uint8_t +{ + kSeekingCharger = 0x40, + kCharging = 0x41, + kDocked = 0x42, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, +}; +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { // Enum for ChangeIndicationEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index ffc13c37e3fe2a..fdc1b4ebd4b475 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -166,6 +166,54 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace ApplicationStruct +namespace ErrorStateStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateID), errorStateID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateLabel), errorStateLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateDetails), errorStateDetails)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kErrorStateID): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateID)); + break; + case to_underlying(Fields::kErrorStateLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateLabel)); + break; + case to_underlying(Fields::kErrorStateDetails): + ReturnErrorOnFailure(DataModel::Decode(reader, errorStateDetails)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace ErrorStateStruct namespace LabelStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -210,6 +258,50 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace LabelStruct +namespace OperationalStateStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateID), operationalStateID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateLabel), operationalStateLabel)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kOperationalStateID): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateID)); + break; + case to_underlying(Fields::kOperationalStateLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateLabel)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace OperationalStateStruct } // namespace Structs } // namespace detail @@ -13113,15 +13205,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace SmokeCoAlarm namespace OperationalState { -namespace Structs { -namespace ErrorStateStruct { +namespace Structs {} // namespace Structs + +namespace Commands { +namespace Pause { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateID), errorStateID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateLabel), errorStateLabel)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorStateDetails), errorStateDetails)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13131,8 +13222,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -13141,15 +13231,105 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kErrorStateID): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateID)); + default: break; - case to_underlying(Fields::kErrorStateLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateLabel)); + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Pause. +namespace Stop { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: break; - case to_underlying(Fields::kErrorStateDetails): - ReturnErrorOnFailure(DataModel::Decode(reader, errorStateDetails)); + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Stop. +namespace Start { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Start. +namespace Resume { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { default: break; } @@ -13157,18 +13337,104 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Resume. +namespace OperationalCommandResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCommandResponseState), commandResponseState)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCommandResponseState): + ReturnErrorOnFailure(DataModel::Decode(reader, commandResponseState)); + break; + default: + break; + } + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } +} // namespace OperationalCommandResponse. +} // namespace Commands -} // namespace ErrorStateStruct -namespace OperationalStateStruct { +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::PhaseList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, phaseList)); + break; + case Attributes::CurrentPhase::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentPhase)); + break; + case Attributes::CountdownTime::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, countdownTime)); + break; + case Attributes::OperationalStateList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateList)); + break; + case Attributes::OperationalState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalState)); + break; + case Attributes::OperationalError::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, operationalError)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +namespace OperationalError { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateID), operationalStateID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kOperationalStateLabel), operationalStateLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kErrorState), errorState)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -13178,8 +13444,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -13188,11 +13453,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kOperationalStateID): - ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateID)); - break; - case to_underlying(Fields::kOperationalStateLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, operationalStateLabel)); + case to_underlying(Fields::kErrorState): + ReturnErrorOnFailure(DataModel::Decode(reader, errorState)); break; default: break; @@ -13201,12 +13463,59 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace OperationalError. +namespace OperationCompletion { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kCompletionErrorCode), completionErrorCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTotalOperationalTime), totalOperationalTime)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPausedTime), pausedTime)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCompletionErrorCode): + ReturnErrorOnFailure(DataModel::Decode(reader, completionErrorCode)); + break; + case to_underlying(Fields::kTotalOperationalTime): + ReturnErrorOnFailure(DataModel::Decode(reader, totalOperationalTime)); + break; + case to_underlying(Fields::kPausedTime): + ReturnErrorOnFailure(DataModel::Decode(reader, pausedTime)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } +} // namespace OperationCompletion. +} // namespace Events -} // namespace OperationalStateStruct -} // namespace Structs +} // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Structs {} // namespace Structs namespace Commands { namespace Pause { @@ -13514,7 +13823,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationCompletion. } // namespace Events -} // namespace OperationalState +} // namespace RoboticVacuumOperationalState namespace HepaFilterMonitoring { namespace Commands { @@ -28080,6 +28389,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::RoboticVacuumOperationalState::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::HepaFilterMonitoring::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 3dd2881b9049c1..502e4e9063aaaa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -124,6 +124,31 @@ struct Type using DecodableType = Type; } // namespace ApplicationStruct +namespace ErrorStateStruct { +enum class Fields : uint8_t +{ + kErrorStateID = 0, + kErrorStateLabel = 1, + kErrorStateDetails = 2, +}; + +struct Type +{ +public: + uint8_t errorStateID = static_cast(0); + Optional errorStateLabel; + Optional errorStateDetails; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace ErrorStateStruct namespace LabelStruct { enum class Fields : uint8_t { @@ -147,6 +172,29 @@ struct Type using DecodableType = Type; } // namespace LabelStruct +namespace OperationalStateStruct { +enum class Fields : uint8_t +{ + kOperationalStateID = 0, + kOperationalStateLabel = 1, +}; + +struct Type +{ +public: + uint8_t operationalStateID = static_cast(0); + Optional operationalStateLabel; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace OperationalStateStruct } // namespace Structs } // namespace detail @@ -16635,54 +16683,8 @@ struct DecodableType } // namespace SmokeCoAlarm namespace OperationalState { namespace Structs { -namespace ErrorStateStruct { -enum class Fields : uint8_t -{ - kErrorStateID = 0, - kErrorStateLabel = 1, - kErrorStateDetails = 2, -}; - -struct Type -{ -public: - ErrorStateEnum errorStateID = static_cast(0); - DataModel::Nullable errorStateLabel; - Optional errorStateDetails; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace ErrorStateStruct -namespace OperationalStateStruct { -enum class Fields : uint8_t -{ - kOperationalStateID = 0, - kOperationalStateLabel = 1, -}; - -struct Type -{ -public: - OperationalStateEnum operationalStateID = static_cast(0); - chip::CharSpan operationalStateLabel; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace OperationalStateStruct +namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; +namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; } // namespace Structs namespace Commands { @@ -17050,7 +17052,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } static constexpr bool kIsFabricScoped = false; - ErrorStateEnum completionErrorCode = static_cast(0); + uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; Optional> pausedTime; @@ -17064,7 +17066,7 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OperationalState::Id; } - ErrorStateEnum completionErrorCode = static_cast(0); + uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; Optional> pausedTime; @@ -17073,6 +17075,402 @@ struct DecodableType } // namespace OperationCompletion } // namespace Events } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Structs { +namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; +namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Pause { +struct Type; +struct DecodableType; +} // namespace Pause + +namespace Stop { +struct Type; +struct DecodableType; +} // namespace Stop + +namespace Start { +struct Type; +struct DecodableType; +} // namespace Start + +namespace Resume { +struct Type; +struct DecodableType; +} // namespace Resume + +namespace OperationalCommandResponse { +struct Type; +struct DecodableType; +} // namespace OperationalCommandResponse + +} // namespace Commands + +namespace Commands { +namespace Pause { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Pause +namespace Stop { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Stop +namespace Start { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Start::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Start::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Start +namespace Resume { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Resume +namespace OperationalCommandResponse { +enum class Fields : uint8_t +{ + kCommandResponseState = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + Structs::ErrorStateStruct::Type commandResponseState; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + Structs::ErrorStateStruct::DecodableType commandResponseState; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace OperationalCommandResponse +} // namespace Commands + +namespace Attributes { + +namespace PhaseList { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = const chip::app::DataModel::Nullable> &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::PhaseList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace PhaseList +namespace CurrentPhase { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPhase::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentPhase +namespace CountdownTime { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CountdownTime::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CountdownTime +namespace OperationalStateList { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalStateList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalStateList +namespace OperationalState { +struct TypeInfo +{ + using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::Type; + using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType; + using DecodableArgType = + const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalState +namespace OperationalError { +struct TypeInfo +{ + using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::Type; + using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::OperationalError::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace OperationalError +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::PhaseList::TypeInfo::DecodableType phaseList; + Attributes::CurrentPhase::TypeInfo::DecodableType currentPhase; + Attributes::CountdownTime::TypeInfo::DecodableType countdownTime; + Attributes::OperationalStateList::TypeInfo::DecodableType operationalStateList; + Attributes::OperationalState::TypeInfo::DecodableType operationalState; + Attributes::OperationalError::TypeInfo::DecodableType operationalError; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace OperationalError { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; + +enum class Fields : uint8_t +{ + kErrorState = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationalError::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + Structs::ErrorStateStruct::Type errorState; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationalError::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + Structs::ErrorStateStruct::DecodableType errorState; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationalError +namespace OperationCompletion { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kCompletionErrorCode = 0, + kTotalOperationalTime = 1, + kPausedTime = 2, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr bool kIsFabricScoped = false; + + uint8_t completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + + uint8_t completionErrorCode = static_cast(0); + Optional> totalOperationalTime; + Optional> pausedTime; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace OperationCompletion +} // namespace Events +} // namespace RoboticVacuumOperationalState namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 9df5738cf6be5c..acebe9520aa223 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -3021,6 +3021,60 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Attributes { + +namespace PhaseList { +static constexpr AttributeId Id = 0x00000000; +} // namespace PhaseList + +namespace CurrentPhase { +static constexpr AttributeId Id = 0x00000001; +} // namespace CurrentPhase + +namespace CountdownTime { +static constexpr AttributeId Id = 0x00000002; +} // namespace CountdownTime + +namespace OperationalStateList { +static constexpr AttributeId Id = 0x00000003; +} // namespace OperationalStateList + +namespace OperationalState { +static constexpr AttributeId Id = 0x00000004; +} // namespace OperationalState + +namespace OperationalError { +static constexpr AttributeId Id = 0x00000005; +} // namespace OperationalError + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index afbdd5fdf33410..daa8633beadfa5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -184,6 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState +namespace RoboticVacuumOperationalState { +static constexpr ClusterId Id = 0x00000061; +} // namespace RoboticVacuumOperationalState namespace HepaFilterMonitoring { static constexpr ClusterId Id = 0x00000071; } // namespace HepaFilterMonitoring diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 54ed91151d52cd..fc3462859b428d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -785,6 +785,32 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Commands { + +namespace Pause { +static constexpr CommandId Id = 0x00000000; +} // namespace Pause + +namespace Stop { +static constexpr CommandId Id = 0x00000001; +} // namespace Stop + +namespace Start { +static constexpr CommandId Id = 0x00000002; +} // namespace Start + +namespace Resume { +static constexpr CommandId Id = 0x00000003; +} // namespace Resume + +namespace OperationalCommandResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace OperationalCommandResponse + +} // namespace Commands +} // namespace RoboticVacuumOperationalState + namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index cc23a3c7c6d1c6..1265841a3eabfe 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -341,6 +341,20 @@ static constexpr EventId Id = 0x00000001; } // namespace Events } // namespace OperationalState +namespace RoboticVacuumOperationalState { +namespace Events { + +namespace OperationalError { +static constexpr EventId Id = 0x00000000; +} // namespace OperationalError + +namespace OperationCompletion { +static constexpr EventId Id = 0x00000001; +} // namespace OperationCompletion + +} // namespace Events +} // namespace RoboticVacuumOperationalState + namespace DoorLock { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index a254d99be4a077..1572384dcf7798 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -363,6 +363,13 @@ #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER #endif +#if defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ + { chip::app::Clusters::RoboticVacuumOperationalState::Id, "Robotic Vacuum Operational State" }, +#else +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER +#endif + #if defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_HEPA_FILTER_MONITORING_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ { chip::app::Clusters::HepaFilterMonitoring::Id, "HEPA Filter Monitoring" }, @@ -978,6 +985,7 @@ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ + CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ CHIP_PRINTCLUSTER_HEPA_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_CERAMIC_FILTER_MONITORING_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index e286a82888ae37..5f02b1ee77f828 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -85,6 +85,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | +| RoboticVacuumOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4863,6 +4864,150 @@ class OperationalStateResume : public ClusterCommand chip::app::Clusters::OperationalState::Commands::Resume::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster RoboticVacuumOperationalState | 0x0061 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Pause | 0x00 | +| * Stop | 0x01 | +| * Start | 0x02 | +| * Resume | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhaseList | 0x0000 | +| * CurrentPhase | 0x0001 | +| * CountdownTime | 0x0002 | +| * OperationalStateList | 0x0003 | +| * OperationalState | 0x0004 | +| * OperationalError | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * OperationalError | 0x0000 | +| * OperationCompletion | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Pause + */ +class RoboticVacuumOperationalStatePause : public ClusterCommand +{ +public: + RoboticVacuumOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::Type mRequest; +}; + +/* + * Command Stop + */ +class RoboticVacuumOperationalStateStop : public ClusterCommand +{ +public: + RoboticVacuumOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000001, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::Type mRequest; +}; + +/* + * Command Start + */ +class RoboticVacuumOperationalStateStart : public ClusterCommand +{ +public: + RoboticVacuumOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000002, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000002, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::Type mRequest; +}; + +/* + * Command Resume + */ +class RoboticVacuumOperationalStateResume : public ClusterCommand +{ +public: + RoboticVacuumOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000061, 0x00000003, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000061, 0x00000003, mRequest); + } + +private: + chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -15528,6 +15673,93 @@ void registerClusterOperationalState(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } +void registerClusterRoboticVacuumOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::RoboticVacuumOperationalState; + + const char * clusterName = "RoboticVacuumOperationalState"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "phase-list", Attributes::PhaseList::Id, credsIssuerConfig), // + make_unique(Id, "current-phase", Attributes::CurrentPhase::Id, credsIssuerConfig), // + make_unique(Id, "countdown-time", Attributes::CountdownTime::Id, credsIssuerConfig), // + make_unique(Id, "operational-state-list", Attributes::OperationalStateList::Id, credsIssuerConfig), // + make_unique(Id, "operational-state", Attributes::OperationalState::Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Attributes::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>>( + Id, "phase-list", Attributes::PhaseList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "current-phase", 0, UINT8_MAX, Attributes::CurrentPhase::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>(Id, "countdown-time", 0, UINT32_MAX, + Attributes::CountdownTime::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "operational-state-list", Attributes::OperationalStateList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique< + WriteAttributeAsComplex>( + Id, "operational-state", Attributes::OperationalState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "operational-error", Attributes::OperationalError::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "phase-list", Attributes::PhaseList::Id, credsIssuerConfig), // + make_unique(Id, "current-phase", Attributes::CurrentPhase::Id, credsIssuerConfig), // + make_unique(Id, "countdown-time", Attributes::CountdownTime::Id, credsIssuerConfig), // + make_unique(Id, "operational-state-list", Attributes::OperationalStateList::Id, credsIssuerConfig), // + make_unique(Id, "operational-state", Attributes::OperationalState::Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Attributes::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Events::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "operation-completion", Events::OperationCompletion::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "operational-error", Events::OperationalError::Id, credsIssuerConfig), // + make_unique(Id, "operation-completion", Events::OperationCompletion::Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -24447,6 +24679,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); + registerClusterRoboticVacuumOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); registerClusterActivatedCarbonFilterMonitoring(commands, credsIssuerConfig); registerClusterCeramicFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 120444bbebbb8b..15f4b09c3119c8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -125,6 +125,46 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Appli ComplexArgumentParser::Finalize(request.applicationID); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateID", "errorStateID", value.isMember("errorStateID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateID, value["errorStateID"])); + valueCopy.removeMember("errorStateID"); + + if (value.isMember("errorStateLabel")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateLabel"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateLabel, value["errorStateLabel"])); + } + valueCopy.removeMember("errorStateLabel"); + + if (value.isMember("errorStateDetails")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateDetails"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateDetails, value["errorStateDetails"])); + } + valueCopy.removeMember("errorStateDetails"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.errorStateID); + ComplexArgumentParser::Finalize(request.errorStateLabel); + ComplexArgumentParser::Finalize(request.errorStateDetails); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value) { @@ -154,6 +194,40 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Label ComplexArgumentParser::Finalize(request.value); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("OperationalStateStruct.operationalStateID", "operationalStateID", + value.isMember("operationalStateID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.operationalStateID, value["operationalStateID"])); + valueCopy.removeMember("operationalStateID"); + + if (value.isMember("operationalStateLabel")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateLabel"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.operationalStateLabel, value["operationalStateLabel"])); + } + valueCopy.removeMember("operationalStateLabel"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.operationalStateID); + ComplexArgumentParser::Finalize(request.operationalStateLabel); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value) @@ -1903,79 +1977,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::IcdManagement::Structs ComplexArgumentParser::Finalize(request.fabricIndex); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateID", "errorStateID", value.isMember("errorStateID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ErrorStateStruct.errorStateLabel", "errorStateLabel", - value.isMember("errorStateLabel"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateID, value["errorStateID"])); - valueCopy.removeMember("errorStateID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateLabel"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateLabel, value["errorStateLabel"])); - valueCopy.removeMember("errorStateLabel"); - - if (value.isMember("errorStateDetails")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "errorStateDetails"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.errorStateDetails, value["errorStateDetails"])); - } - valueCopy.removeMember("errorStateDetails"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.errorStateID); - ComplexArgumentParser::Finalize(request.errorStateLabel); - ComplexArgumentParser::Finalize(request.errorStateDetails); -} - -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("OperationalStateStruct.operationalStateID", "operationalStateID", - value.isMember("operationalStateID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist( - "OperationalStateStruct.operationalStateLabel", "operationalStateLabel", value.isMember("operationalStateLabel"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.operationalStateID, value["operationalStateID"])); - valueCopy.removeMember("operationalStateID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "operationalStateLabel"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.operationalStateLabel, value["operationalStateLabel"])); - valueCopy.removeMember("operationalStateLabel"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.operationalStateID); - ComplexArgumentParser::Finalize(request.operationalStateLabel); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index dea2397ae70c89..752647ee7e54bf 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -37,10 +37,20 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::ErrorStateStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value); @@ -234,16 +244,6 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::Type & request); - -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::Type & request); - static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 085d9de02833c8..596893dc438cf6 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -112,6 +112,39 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ErrorStateStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ErrorStateID", indent + 1, value.errorStateID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ErrorStateLabel", indent + 1, value.errorStateLabel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateLabel'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ErrorStateDetails", indent + 1, value.errorStateDetails); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateDetails'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value) { @@ -137,6 +170,31 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("OperationalStateID", indent + 1, value.operationalStateID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("OperationalStateLabel", indent + 1, value.operationalStateLabel); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateLabel'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value) { @@ -1719,65 +1777,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("ErrorStateID", indent + 1, value.errorStateID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ErrorStateLabel", indent + 1, value.errorStateLabel); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateLabel'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ErrorStateDetails", indent + 1, value.errorStateDetails); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ErrorStateDetails'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("OperationalStateID", indent + 1, value.operationalStateID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("OperationalStateLabel", indent + 1, value.operationalStateLabel); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OperationalStateLabel'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value) { @@ -3713,6 +3712,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Events::DoorLockAlarm::DecodableType & value) { @@ -4494,6 +4541,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("commandResponseState", indent + 1, value.commandResponseState)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value) { @@ -8483,6 +8539,74 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case RoboticVacuumOperationalState::Id: { + switch (path.mAttributeId) + { + case RoboticVacuumOperationalState::Attributes::PhaseList::Id: { + chip::app::DataModel::Nullable> value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhaseList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::CurrentPhase::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPhase", 1, value); + } + case RoboticVacuumOperationalState::Attributes::CountdownTime::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CountdownTime", 1, value); + } + case RoboticVacuumOperationalState::Attributes::OperationalStateList::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalStateList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::OperationalState::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalState", 1, value); + } + case RoboticVacuumOperationalState::Attributes::OperationalError::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case RoboticVacuumOperationalState::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case RoboticVacuumOperationalState::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case RoboticVacuumOperationalState::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case HepaFilterMonitoring::Id: { switch (path.mAttributeId) { @@ -16308,6 +16432,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case RoboticVacuumOperationalState::Id: { + switch (path.mCommandId) + { + case RoboticVacuumOperationalState::Commands::OperationalCommandResponse::Id: { + RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalCommandResponse", 1, value); + } + } + break; + } case DoorLock::Id: { switch (path.mCommandId) { @@ -16920,6 +17055,22 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case RoboticVacuumOperationalState::Id: { + switch (header.mPath.mEventId) + { + case RoboticVacuumOperationalState::Events::OperationalError::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalError", 1, value); + } + case RoboticVacuumOperationalState::Events::OperationCompletion::Id: { + chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationCompletion", 1, value); + } + } + break; + } case DoorLock::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 5199662816d440..e7e743dfb77cdf 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -29,9 +29,15 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ErrorStateStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value); @@ -147,12 +153,6 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::ErrorStateStruct::DecodableType & value); - -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::OperationalState::Structs::OperationalStateStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value); @@ -330,6 +330,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationalError::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationCompletion::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -472,6 +478,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index b30091d2b0e58e..7469d4fb62afec 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -88,6 +88,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | +| RoboticVacuumOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -45032,6 +45033,1057 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib } }; +/*----------------------------------------------------------------------------*\ +| Cluster RoboticVacuumOperationalState | 0x0061 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Pause | 0x00 | +| * Stop | 0x01 | +| * Start | 0x02 | +| * Resume | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * PhaseList | 0x0000 | +| * CurrentPhase | 0x0001 | +| * CountdownTime | 0x0002 | +| * OperationalStateList | 0x0003 | +| * OperationalState | 0x0004 | +| * OperationalError | 0x0005 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * OperationalError | 0x0000 | +| * OperationCompletion | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command Pause + */ +class RoboticVacuumOperationalStatePause : public ClusterCommand { +public: + RoboticVacuumOperationalStatePause() + : ClusterCommand("pause") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster pauseWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Stop + */ +class RoboticVacuumOperationalStateStop : public ClusterCommand { +public: + RoboticVacuumOperationalStateStop() + : ClusterCommand("stop") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster stopWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Start + */ +class RoboticVacuumOperationalStateStart : public ClusterCommand { +public: + RoboticVacuumOperationalStateStart() + : ClusterCommand("start") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster startWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Command Resume + */ +class RoboticVacuumOperationalStateResume : public ClusterCommand { +public: + RoboticVacuumOperationalStateResume() + : ClusterCommand("resume") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster resumeWithParams:params + completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +/* + * Attribute PhaseList + */ +class ReadRoboticVacuumOperationalStatePhaseList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStatePhaseList() + : ReadAttribute("phase-list") + { + } + + ~ReadRoboticVacuumOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000000) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState PhaseList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStatePhaseList() + : SubscribeAttribute("phase-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStatePhaseList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000000) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributePhaseListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CurrentPhase + */ +class ReadRoboticVacuumOperationalStateCurrentPhase : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateCurrentPhase() + : ReadAttribute("current-phase") + { + } + + ~ReadRoboticVacuumOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState CurrentPhase read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() + : SubscribeAttribute("current-phase") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentPhaseWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute CountdownTime + */ +class ReadRoboticVacuumOperationalStateCountdownTime : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateCountdownTime() + : ReadAttribute("countdown-time") + { + } + + ~ReadRoboticVacuumOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000002) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState CountdownTime read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() + : SubscribeAttribute("countdown-time") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000002) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCountdownTimeWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalStateList + */ +class ReadRoboticVacuumOperationalStateOperationalStateList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateOperationalStateList() + : ReadAttribute("operational-state-list") + { + } + + ~ReadRoboticVacuumOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState OperationalStateList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() + : SubscribeAttribute("operational-state-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOperationalStateListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalState + */ +class ReadRoboticVacuumOperationalStateOperationalState : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateOperationalState() + : ReadAttribute("operational-state") + { + } + + ~ReadRoboticVacuumOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalStateWithCompletion:^( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState OperationalState read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateOperationalState() + : SubscribeAttribute("operational-state") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateOperationalState() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOperationalStateWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^( + MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute OperationalError + */ +class ReadRoboticVacuumOperationalStateOperationalError : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateOperationalError() + : ReadAttribute("operational-error") + { + } + + ~ReadRoboticVacuumOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeOperationalErrorWithCompletion:^( + MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState OperationalError read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateOperationalError() + : SubscribeAttribute("operational-error") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateOperationalError() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeOperationalErrorWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute GeneratedCommandList + */ +class ReadRoboticVacuumOperationalStateGeneratedCommandList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadRoboticVacuumOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState GeneratedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AcceptedCommandList + */ +class ReadRoboticVacuumOperationalStateAcceptedCommandList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadRoboticVacuumOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState AcceptedCommandList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute EventList + */ +class ReadRoboticVacuumOperationalStateEventList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateEventList() + : ReadAttribute("event-list") + { + } + + ~ReadRoboticVacuumOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState EventList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateEventList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute AttributeList + */ +class ReadRoboticVacuumOperationalStateAttributeList : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadRoboticVacuumOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState AttributeList read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute FeatureMap + */ +class ReadRoboticVacuumOperationalStateFeatureMap : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadRoboticVacuumOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState FeatureMap read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadRoboticVacuumOperationalStateClusterRevision : public ReadAttribute { +public: + ReadRoboticVacuumOperationalStateClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadRoboticVacuumOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + if (error != nil) { + LogNSError("RoboticVacuumOperationalState ClusterRevision read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeRoboticVacuumOperationalStateClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + /*----------------------------------------------------------------------------*\ | Cluster HepaFilterMonitoring | 0x0071 | |------------------------------------------------------------------------------| @@ -122595,6 +123647,51 @@ void registerClusterOperationalState(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterRoboticVacuumOperationalState(Commands & commands) +{ + using namespace chip::app::Clusters::RoboticVacuumOperationalState; + + const char * clusterName = "RoboticVacuumOperationalState"; + + commands_list clusterCommands = { + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(Id), // + make_unique(Id), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterHepaFilterMonitoring(Commands & commands) { using namespace chip::app::Clusters::HepaFilterMonitoring; @@ -125301,6 +126398,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterOperationalState(commands); + registerClusterRoboticVacuumOperationalState(commands); registerClusterHepaFilterMonitoring(commands); registerClusterActivatedCarbonFilterMonitoring(commands); registerClusterDoorLock(commands); From b9f04768574f88246e267ae843350cb20bbb9c9e Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 15 Jun 2023 17:48:24 +0200 Subject: [PATCH 17/31] [chiptool.py] Remove the dot in the cluster name for the chip-tool adapter before sending it over the wire (#27260) Co-authored-by: Matt Hazley --- .../matter_chip_tool_adapter/encoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index 2b5463412e4f43..f395df13674a7d 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -376,7 +376,7 @@ def __to_lower_camel_case(self, name): return name[:1].lower() + name[1:] def __format_cluster_name(self, name): - return name.lower().replace(' ', '').replace('/', '').lower() + return name.lower().replace(' ', '').replace('/', '').replace('.', '').lower() def __format_command_name(self, name): if name is None: From dea6db79cb348f32df3c2114bf94bcef901080a2 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Thu, 15 Jun 2023 12:46:28 -0400 Subject: [PATCH 18/31] Add framework for device basic composition test (#27208) * Add basic framework for device basic composition test Problem: - No test exists that validates global data model and system model rules related to device composition. - This makes verification patchy and can miss non-conformance. Changes in this PR: - Introduce the TC_DeviceBasicComposition test with already a few important tests, such as validation of presence and content for all mandatory global attributes. - Some additional frameworking to report non-fatal problems in Python testing framework. - Ability to dump the topology of a device. Testing done: - Ran the test against all clusters app in a bootstrapped environment - `scripts/build_python.sh -m platform -i build-env` - `. ./scripts/activate.sh` - `scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone chip_config_network_layer_ble=false` - Then in a different terminal: - `rm -f kvs1 && out/debug/standalone/chip-all-clusters-app --KVS kvs1` - Back in initial terminal: - `python3 src/python_testing/TC_DeviceBasicComposition.py --manual-code 34970112332 --string-arg dump_device_composition_path:dump_file` - Added the test to CI running against same * Restyled by isort * Fix lints * Apply review comments * Fix to work with Python 3.9 * Restyled by autopep8 * Fix CI --------- Co-authored-by: Restyled.io Co-authored-by: tennessee.carmelveilleux@gmail.com --- .github/workflows/tests.yaml | 1 + .../TC_DeviceBasicComposition.py | 395 ++++++++++++++++++ src/python_testing/matter_testing_support.py | 117 +++++- 3 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 src/python_testing/TC_DeviceBasicComposition.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 47ad5341ac7f4d..4004b39e13af68 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -510,6 +510,7 @@ jobs: run: | scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_RR_1_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' + scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DeviceBasicComposition.py" --script-args "--storage-path admin_storage.json --manual-code 10054912339"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_SC_3_6.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_7.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1 --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_TestEventTrigger.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py new file mode 100644 index 00000000000000..2e175d6ffc409d --- /dev/null +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -0,0 +1,395 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import base64 +import copy +import json +import logging +import pathlib +import sys +from dataclasses import dataclass +from pprint import pprint +from typing import Any, Callable, Optional + +import chip.clusters as Clusters +import chip.tlv +from chip import discovery +from chip.clusters.Attribute import ValueDecodeFailure +from chip.exceptions import ChipStackError +from chip.setup_payload import SetupPayload +from matter_testing_support import AttributePathLocation, MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +def MatterTlvToJson(tlv_data: dict[int, Any]) -> dict[str, Any]: + """Given TLV data for a specific cluster instance, convert to the Matter JSON format.""" + + matter_json_dict = {} + + key_type_mappings = { + chip.tlv.uint: "UINT", + int: "INT", + bool: "BOOL", + list: "ARRAY", + dict: "STRUCT", + chip.tlv.float32: "FLOAT", + float: "DOUBLE", + bytes: "BYTES", + str: "STRING", + ValueDecodeFailure: "ERROR", + type(None): "NULL", + } + + def ConvertValue(value) -> Any: + if isinstance(value, ValueDecodeFailure): + raise ValueError(f"Bad Value: {str(value)}") + + if isinstance(value, bytes): + return base64.b64encode(value).decode("UTF-8") + elif isinstance(value, list): + value = [ConvertValue(item) for item in value] + elif isinstance(value, dict): + value = MatterTlvToJson(value) + + return value + + for key in tlv_data: + value_type = type(tlv_data[key]) + value = copy.deepcopy(tlv_data[key]) + + element_type: str = key_type_mappings[value_type] + sub_element_type = "" + + try: + new_value = ConvertValue(value) + except ValueError as e: + new_value = str(e) + + if element_type: + if element_type == "ARRAY": + if len(new_value): + sub_element_type = key_type_mappings[type(tlv_data[key][0])] + else: + sub_element_type = "?" + + new_key = "" + if element_type: + if sub_element_type: + new_key = f"{str(key)}:{element_type}-{sub_element_type}" + else: + new_key = f"{str(key)}:{element_type}" + else: + new_key = str(key) + + matter_json_dict[new_key] = new_value + + return matter_json_dict + + +def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: + """Returns a checker for whether `obj` is an int that fits in a range.""" + def int_in_range_checker(obj: Any): + """Inner checker logic for check_int_in_range + + Checker validates that `obj` must have decoded as an integral value in range [min_value, max_value]. + + On failure, a ValueError is raised with a diagnostic message. + """ + if obj is None and allow_null: + return + + if not isinstance(obj, int) and not isinstance(obj, chip.tlv.uint): + raise ValueError(f"Value {str(obj)} is not an integer or uint (decoded type: {type(obj)})") + int_val = int(obj) + if (int_val < min_value) or (int_val > max_value): + raise ValueError( + f"Value {int_val} (0x{int_val:X}) not in range [{min_value}, {max_value}] ([0x{min_value:X}, 0x{max_value:X}])") + + return int_in_range_checker + + +def check_list_of_ints_in_range(min_value: int, max_value: int, min_size: int = 0, max_size: int = 65535, allow_null: bool = False) -> Callable: + """Returns a checker for whether `obj` is a list of ints that fit in a range.""" + def list_of_ints_in_range_checker(obj: Any): + """Inner checker for check_list_of_ints_in_range. + + Checker validates that `obj` must have decoded as a list of integral values in range [min_value, max_value]. + The length of the list must be between [min_size, max_size]. + + On failure, a ValueError is raised with a diagnostic message. + """ + if obj is None and allow_null: + return + + if not isinstance(obj, list): + raise ValueError(f"Value {str(obj)} is not a list, but a list was expected (decoded type: {type(obj)})") + + if len(obj) < min_size or len(obj) > max_size: + raise ValueError( + f"Value {str(obj)} is a list of size {len(obj)}, but expected a list with size in range [{min_size}, {max_size}]") + + for val_idx, val in enumerate(obj): + if not isinstance(val, int) and not isinstance(val, chip.tlv.uint): + raise ValueError( + f"At index {val_idx} in {str(obj)}, value {val} is not an int/uint, but an int/uint was expected (decoded type: {type(val)})") + + int_val = int(val) + if not ((int_val >= min_value) and (int_val <= max_value)): + raise ValueError( + f"At index {val_idx} in {str(obj)}, value {int_val} (0x{int_val:X}) not in range [{min_value}, {max_value}] ([0x{min_value:X}, 0x{max_value:X}])") + + return list_of_ints_in_range_checker + + +def check_non_empty_list_of_ints_in_range(min_value: int, max_value: int, max_size: int = 65535, allow_null: bool = False) -> Callable: + """Returns a checker for whether `obj` is a non-empty list of ints that fit in a range.""" + return check_list_of_ints_in_range(min_value, max_value, min_size=1, max_size=max_size, allow_null=allow_null) + + +class TC_DeviceBasicComposition(MatterBaseTest): + @async_test_body + async def setup_class(self): + super().setup_class() + dev_ctrl = self.default_controller + self.problems = [] + + # TODO: Handle already commissioned devices and add argument to specify "let's do PASE" + do_test_over_pase = self.user_params.get("use_pase_only", True) + dump_device_composition_path: Optional[str] = self.user_params.get("dump_device_composition_path", None) + + if do_test_over_pase: + if self.matter_test_config.qr_code_content is not None: + qr_code = self.matter_test_config.qr_code_content + try: + setup_payload = SetupPayload().ParseQrCode(qr_code) + except ChipStackError: + asserts.fail(f"QR code '{qr_code} failed to parse properly as a Matter setup code.") + + elif self.matter_test_config.manual_code is not None: + manual_code = self.matter_test_config.manual_code + try: + setup_payload = SetupPayload().ParseManualPairingCode(manual_code) + except ChipStackError: + asserts.fail( + f"Manual code code '{manual_code}' failed to parse properly as a Matter setup code. Check that all digits are correct and length is 11 or 21 characters.") + else: + asserts.fail("Require either --qr-code or --manual-code to proceed with PASE needed for test.") + + if setup_payload.short_discriminator is not None: + filter_type = discovery.FilterType.SHORT_DISCRIMINATOR + filter_value = setup_payload.short_discriminator + else: + filter_type = discovery.FilterType.LONG_DISCRIMINATOR + filter_value = setup_payload.long_discriminator + + commissionable_nodes = dev_ctrl.DiscoverCommissionableNodes( + filter_type, filter_value, stopOnFirst=True, timeoutSecond=15) + logging.info(f"Commissionable nodes: {commissionable_nodes}") + # TODO: Support BLE + if commissionable_nodes is not None and len(commissionable_nodes) > 0: + commissionable_node = commissionable_nodes[0] + instance_name = f"{commissionable_node.instanceName}._matterc._udp.local" + vid = f"{commissionable_node.vendorId}" + pid = f"{commissionable_node.productId}" + address = f"{commissionable_node.addresses[0]}" + logging.info(f"Found instance {instance_name}, VID={vid}, PID={pid}, Address={address}") + + node_id = 1 + dev_ctrl.EstablishPASESessionIP(address, setup_payload.setup_passcode, node_id) + else: + asserts.fail("Failed to find the DUT according to command line arguments.") + else: + asserts.fail("TODO: Support testing on already commissioned devices") + + wildcard_read = (await dev_ctrl.Read(node_id, [()])) + endpoints_tlv = wildcard_read.tlvAttributes + + node_dump_dict = {endpoint_id: MatterTlvToJson(endpoints_tlv[endpoint_id]) for endpoint_id in endpoints_tlv} + logging.info(f"Raw TLV contents of Node: {json.dumps(node_dump_dict, indent=2)}") + + if dump_device_composition_path is not None: + with open(pathlib.Path(dump_device_composition_path).with_suffix(".json"), "wt+") as outfile: + json.dump(node_dump_dict, outfile, indent=2) + with open(pathlib.Path(dump_device_composition_path).with_suffix(".txt"), "wt+") as outfile: + pprint(wildcard_read.attributes, outfile, indent=1, width=200, compact=True) + + logging.info("###########################################################") + logging.info("Start of actual tests") + logging.info("###########################################################") + + # ======= State kept for use by all tests ======= + + # All endpoints in "full object" indexing format + self.endpoints = wildcard_read.attributes + + # All endpoints in raw TLV format + self.endpoints_tlv = wildcard_read.tlvAttributes + + def get_test_name(self) -> str: + """Return the function name of the caller. Used to create logging entries.""" + return sys._getframe().f_back.f_code.co_name + + def fail_current_test(self, msg: Optional[str] = None): + if not msg: + # Without a message, just log the last problem seen + asserts.fail(msg=self.problems[-1].problem) + else: + asserts.fail(msg) + + # ======= START OF ACTUAL TESTS ======= + def test_endpoint_zero_present(self): + logging.info("Validating that the Root Node endpoint is present (EP0)") + if 0 not in self.endpoints: + self.record_error(self.get_test_name(), location=AttributePathLocation(endpoint_id=0), + problem="Did not find Endpoint 0.", spec_location="Endpoint Composition") + self.fail_current_test() + + def test_descriptor_present_on_each_endpoint(self): + logging.info("Validating each endpoint has a descriptor cluster") + + success = True + for endpoint_id, endpoint in self.endpoints.items(): + has_descriptor = (Clusters.Descriptor in endpoint) + logging.info(f"Checking descriptor on Endpoint {endpoint_id}: {'found' if has_descriptor else 'not_found'}") + if not has_descriptor: + self.record_error(self.get_test_name(), location=AttributePathLocation(endpoint_id=endpoint_id, cluster_id=Clusters.Descriptor.id), + problem=f"Did not find a descriptor on endpoint {endpoint_id}", spec_location="Base Cluster Requirements for Matter") + success = False + + if not success: + self.fail_current_test("At least one endpoint was missing the descriptor cluster.") + + def test_global_attributes_present_on_each_cluster(self): + logging.info("Validating each cluster has the mandatory global attributes") + + @dataclass + class RequiredMandatoryAttribute: + id: int + name: str + validator: Callable + + ATTRIBUTE_LIST_ID = 0xFFFB + + ATTRIBUTES_TO_CHECK = [ + RequiredMandatoryAttribute(id=0xFFFD, name="ClusterRevision", validator=check_int_in_range(1, 0xFFFF)), + RequiredMandatoryAttribute(id=0xFFFC, name="FeatureMap", validator=check_int_in_range(0, 0xFFFF_FFFF)), + RequiredMandatoryAttribute(id=0xFFFB, name="AttributeList", + validator=check_non_empty_list_of_ints_in_range(0, 0xFFFF_FFFF)), + # TODO: Check for EventList + # RequiredMandatoryAttribute(id=0xFFFA, name="EventList", validator=check_list_of_ints_in_range(0, 0xFFFF_FFFF)), + RequiredMandatoryAttribute(id=0xFFF9, name="AcceptedCommandList", + validator=check_list_of_ints_in_range(0, 0xFFFF_FFFF)), + RequiredMandatoryAttribute(id=0xFFF8, name="GeneratedCommandList", + validator=check_list_of_ints_in_range(0, 0xFFFF_FFFF)), + ] + + success = True + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + for req_attribute in ATTRIBUTES_TO_CHECK: + attribute_string = self.cluster_mapper.get_attribute_string(cluster_id, req_attribute.id) + + has_attribute = (req_attribute.id in cluster) + location = AttributePathLocation(endpoint_id, cluster_id, req_attribute.id) + logging.info( + f"Checking for mandatory global {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}: {'found' if has_attribute else 'not_found'}") + + # Check attribute is actually present + if not has_attribute: + self.record_error(self.get_test_name(), location=location, + problem=f"Did not find mandatory global {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}", spec_location="Global Elements") + success = False + continue + + # Validate attribute value based on the provided validator. + try: + req_attribute.validator(cluster[req_attribute.id]) + except ValueError as e: + self.record_error(self.get_test_name(), location=location, + problem=f"Failed validation of value on {location.as_string(self.cluster_mapper)}: {str(e)}", spec_location="Global Elements") + success = False + continue + + # Validate presence of claimed attributes + if success: + # TODO: Also check the reverse: that each attribute appears in the AttributeList. + logging.info( + "Validating that a wildcard read on each cluster provided all attributes claimed in AttributeList mandatory global attribute") + + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + attribute_list = cluster[ATTRIBUTE_LIST_ID] + for attribute_id in attribute_list: + location = AttributePathLocation(endpoint_id, cluster_id, attribute_id) + has_attribute = attribute_id in cluster + + attribute_string = self.cluster_mapper.get_attribute_string(cluster_id, attribute_id) + logging.info( + f"Checking presence of claimed supported {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}: {'found' if has_attribute else 'not_found'}") + + # Check attribute is actually present. + if not has_attribute: + # TODO: Handle detecting write-only attributes from schema. + if "WriteOnly" in attribute_string: + continue + + self.record_error(self.get_test_name(), location=location, + problem=f"Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed in AttributeList ({attribute_list})", spec_location="AttributeList Attribute") + success = False + continue + + attribute_value = cluster[attribute_id] + if isinstance(attribute_value, ValueDecodeFailure): + self.record_warning(self.get_test_name(), location=location, + problem=f"Found a failure to read/decode {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed as supported in AttributeList ({attribute_list}): {str(attribute_value)}", spec_location="AttributeList Attribute") + # Warn only for now + # TODO: Fail in the future + continue + + if not success: + self.fail_current_test( + "At least one cluster was missing a mandatory global attribute or had differences between claimed attributes supported and actual.") + + def test_all_attribute_strings_valid(self): + asserts.skip("TODO: Validate every string in the attribute tree is valid UTF-8 and has no nulls") + + def test_all_event_strings_valid(self): + asserts.skip("TODO: Validate every string in the read events is valid UTF-8 and has no nulls") + + def test_all_schema_scalars(self): + asserts.skip("TODO: Validate all int/uint are in range of the schema (or null if nullable) for known attributes") + + def test_all_commands_reported_are_executable(self): + asserts.skip("TODO: Validate all commands reported in AcceptedCommandList are actually executable") + + def test_dump_all_pics_for_all_endpoints(self): + asserts.skip("TODO: Make a test that generates the basic PICS list for each endpoint based on actually reported contents") + + def test_all_schema_mandatory_elements_present(self): + asserts.skip( + "TODO: Make a test that ensures every known cluster has the mandatory elements present (commands, attributes) based on features") + + def test_all_endpoints_have_valid_composition(self): + asserts.skip( + "TODO: Make a test that verifies each endpoint has valid set of device types, and that the device type conformance is respected for each") + + def test_topology_is_valid(self): + asserts.skip("TODO: Make a test that verifies each endpoint only lists direct descendants, except Root Node and Aggregator endpoints that list all their descendants") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index 4c1e24e8eb8a21..b9a9add64bc46e 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -30,7 +30,8 @@ from dataclasses import asdict as dataclass_asdict from dataclasses import dataclass, field from datetime import datetime, timedelta, timezone -from typing import List, Optional, Tuple +from enum import Enum +from typing import List, Optional, Tuple, Union from chip.tlv import float32, uint @@ -239,6 +240,87 @@ class MatterTestConfig: chip_tool_credentials_path: Optional[pathlib.Path] = None +class ClusterMapper: + """Describe clusters/attributes using schema names.""" + + def __init__(self, legacy_cluster_mapping) -> None: + self._mapping = legacy_cluster_mapping + + def get_cluster_string(self, cluster_id: int) -> str: + mapping = self._mapping._CLUSTER_ID_DICT.get(cluster_id, None) + if not mapping: + return f"Cluster Unknown ({cluster_id}, 0x{cluster_id:08X})" + else: + name = mapping["clusterName"] + return f"Cluster {name} ({cluster_id}, 0x{cluster_id:04X})" + + def get_attribute_string(self, cluster_id: int, attribute_id) -> str: + mapping = self._mapping._CLUSTER_ID_DICT.get(cluster_id, None) + if not mapping: + return f"Attribute Unknown ({attribute_id}, 0x{attribute_id:08X})" + else: + attribute_mapping = mapping["attributes"].get(attribute_id, None) + + if not attribute_mapping: + return f"Attribute Unknown ({attribute_id}, 0x{attribute_id:08X})" + else: + attribute_name = attribute_mapping["attributeName"] + return f"Attribute {attribute_name} ({attribute_id}, 0x{attribute_id:04X})" + + +@dataclass +class AttributePathLocation: + endpoint_id: int + cluster_id: Optional[int] = None + attribute_id: Optional[int] = None + + def as_cluster_string(self, mapper: ClusterMapper): + desc = f"Endpoint {self.endpoint_id}" + if self.cluster_id is not None: + desc += f", {mapper.get_cluster_string(self.cluster_id)}" + return desc + + def as_string(self, mapper: ClusterMapper): + desc = self.as_cluster_string(mapper) + if self.cluster_id is not None and self.attribute_id is not None: + desc += f", {mapper.get_attribute_string(self.cluster_id, self.attribute_id)}" + + return desc + + +@dataclass +class EventPathLocation: + endpoint_id: int + cluster_id: int + event_id: int + + +@dataclass +class CommandPathLocation: + endpoint_id: int + cluster_id: int + command_id: int + +# ProblemSeverity is not using StrEnum, but rather Enum, since StrEnum only +# appeared in 3.11. To make it JSON serializable easily, multiple inheritance +# from `str` is used. See https://stackoverflow.com/a/51976841. + + +class ProblemSeverity(str, Enum): + NOTE = "NOTE" + WARNING = "WARNING" + ERROR = "ERROR" + + +@dataclass +class ProblemNotice: + test_name: str + location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation] + severity: ProblemSeverity + problem: str + spec_location: str = "" + + class MatterStackState: def __init__(self, config: MatterTestConfig): self._logger = logger @@ -325,6 +407,9 @@ class MatterBaseTest(base_test.BaseTestClass): def __init__(self, *args): super().__init__(*args) + # List of accumulated problems across all tests + self.problems = [] + @property def matter_test_config(self) -> MatterTestConfig: return unstash_globally(self.user_params.get("matter_test_config")) @@ -345,6 +430,27 @@ def certificate_authority_manager(self) -> chip.CertificateAuthority.Certificate def dut_node_id(self) -> int: return self.matter_test_config.dut_node_ids[0] + def setup_class(self): + super().setup_class() + + # Mappings of cluster IDs to names and metadata. + # TODO: Move to using non-generated code and rather use data model description (.matter or .xml) + self.cluster_mapper = ClusterMapper(self.default_controller._Cluster) + + def teardown_class(self): + """Final teardown after all tests: log all problems""" + if len(self.problems) == 0: + return + + logging.info("###########################################################") + logging.info("Problems found:") + logging.info("===============") + for problem in self.problems: + logging.info(f"- {json.dumps(dataclass_asdict(problem))}") + logging.info("###########################################################") + + super().teardown_class() + def check_pics(self, pics_key: str) -> bool: picsd = self.matter_test_config.pics pics_key = pics_key.strip().upper() @@ -406,6 +512,15 @@ async def send_single_cmd( def print_step(self, stepnum: int, title: str) -> None: logging.info('***** Test Step %d : %s', stepnum, title) + def record_error(self, test_name: str, location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation], problem: str, spec_location: str = ""): + self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.ERROR, problem, spec_location)) + + def record_warning(self, test_name: str, location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation], problem: str, spec_location: str = ""): + self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.WARNING, problem, spec_location)) + + def record_note(self, test_name: str, location: Union[AttributePathLocation, EventPathLocation, CommandPathLocation], problem: str, spec_location: str = ""): + self.problems.append(ProblemNotice(test_name, location, ProblemSeverity.NOTE, problem, spec_location)) + def generate_mobly_test_config(matter_test_config: MatterTestConfig): test_run_config = TestRunConfig() From eef95295e0cdb91beaf2f5df3909c2f1cc14f8e4 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Thu, 15 Jun 2023 13:12:46 -0400 Subject: [PATCH 19/31] Add MG12 for SLC build (#27245) --- .github/workflows/examples-efr32.yaml | 1 + examples/lighting-app/silabs/BUILD.gn | 1 + examples/platform/silabs/matter-platform.slcp | 7 +------ third_party/silabs/slc_gen/run_slc.py | 16 +++++++++++++++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 0f5db5783411e4..1772f5b931333e 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -88,6 +88,7 @@ jobs: timeout-minutes: 30 run: | scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4187C --slc_generate --docker + scripts/examples/gn_silabs_example.sh examples/lighting-app/silabs ./out/light-app BRD4164A --slc_generate --docker rm -rf ./out/ - name: Build some BRD4187C variants timeout-minutes: 90 diff --git a/examples/lighting-app/silabs/BUILD.gn b/examples/lighting-app/silabs/BUILD.gn index a9687bb3fe061d..ded0e41c42b70a 100644 --- a/examples/lighting-app/silabs/BUILD.gn +++ b/examples/lighting-app/silabs/BUILD.gn @@ -59,6 +59,7 @@ if (slc_generate) { "${use_wstk_buttons}", "${use_wstk_leds}", "${use_external_flash}", + "${silabs_mcu}", ], "list lines")) } diff --git a/examples/platform/silabs/matter-platform.slcp b/examples/platform/silabs/matter-platform.slcp index 0eee476075016c..24e7cc54b4bb15 100644 --- a/examples/platform/silabs/matter-platform.slcp +++ b/examples/platform/silabs/matter-platform.slcp @@ -48,11 +48,6 @@ component: - {id: rail_lib_multiprotocol} - {id: bluetooth_feature_system} - {id: bluetooth_feature_scanner} -- instance: [vcom] - id: uartdrv_usart -- instance: [vcom] - id: uartdrv_eusart - config_file: - override: @@ -83,7 +78,7 @@ requires: - condition: [device_series_2] name: uartdrv_eusart - condition: [device_series_2] - name: device_init_dpll + name: device_init_dpll ui_hints: highlight: diff --git a/third_party/silabs/slc_gen/run_slc.py b/third_party/silabs/slc_gen/run_slc.py index 5083948e3e7eb1..87a481ea3c9a80 100644 --- a/third_party/silabs/slc_gen/run_slc.py +++ b/third_party/silabs/slc_gen/run_slc.py @@ -4,7 +4,7 @@ import subprocess import sys -if len(sys.argv) != 7: +if len(sys.argv) != 8: print("wrong number of arguments") sys.exit(1) @@ -13,12 +13,20 @@ def asBoolean(valueToTest): return ("true" == valueToTest) +def isMG24(partnumber): + if "EFR32MG24" in partnumber or "MGM240" in partnumber: + return True + else: + return False + + root_path = sys.argv[1] silabs_board = str(sys.argv[2]).lower() disable_lcd = asBoolean(sys.argv[3]) use_wstk_buttons = asBoolean(sys.argv[4]) use_wstk_leds = asBoolean(sys.argv[5]) use_external_flash = asBoolean(sys.argv[6]) +silabs_mcu = str(sys.argv[7]) slcp_file_path = os.path.join(root_path, "examples/platform/silabs/matter-platform.slcp") template_path = os.path.join(root_path, "third_party/silabs/slc_gen/") @@ -26,6 +34,12 @@ def asBoolean(valueToTest): slc_arguments = "" +# Add Familly specific component +if isMG24(silabs_mcu): + slc_arguments += "uartdrv_eusart:vcom," +else: + slc_arguments += "uartdrv_usart:vcom," + # Translate GN arguments in SLC arguments if not disable_lcd: slc_arguments += "memlcd_usart,dmd_memlcd," From 8fbcc1be6e910449c8a9b2884658dd99bef18808 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 15 Jun 2023 12:57:27 -0700 Subject: [PATCH 20/31] Move enum class VendorId out of OnboardingPayload (#27254) --- .../setuppayloadscanner/QrCodeInfo.kt | 2 +- src/controller/java/BUILD.gn | 1 + .../onboardingpayload/OnboardingPayload.kt | 719 +---------------- .../onboardingpayload/OptionalQRCodeInfo.kt | 20 +- .../src/chip/onboardingpayload/VendorId.kt | 726 ++++++++++++++++++ 5 files changed, 752 insertions(+), 716 deletions(-) create mode 100644 src/controller/java/src/chip/onboardingpayload/VendorId.kt diff --git a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt index c9b2367ee998ba..8715ac7f071160 100644 --- a/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt +++ b/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/QrCodeInfo.kt @@ -1,7 +1,7 @@ package com.google.chip.chiptool.setuppayloadscanner import android.os.Parcelable -import chip.onboardingpayload.OptionalQRCodeInfo.OptionalQRCodeInfoType +import chip.onboardingpayload.OptionalQRCodeInfoType import kotlinx.parcelize.Parcelize @Parcelize diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 054f59db9ed36c..6b462d85fd85be 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -272,6 +272,7 @@ kotlin_library("onboarding_payload") { "src/chip/onboardingpayload/OnboardingPayload.kt", "src/chip/onboardingpayload/OnboardingPayloadParser.kt", "src/chip/onboardingpayload/OptionalQRCodeInfo.kt", + "src/chip/onboardingpayload/VendorId.kt", "src/chip/onboardingpayload/Verhoeff.kt", "src/chip/onboardingpayload/Verhoeff10.kt", ] diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt index a8432a36d474aa..23b9b2fa35b3b0 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt @@ -64,6 +64,20 @@ const val kCommissioningTimeoutTag = 0x04 const val kSetupPINCodeMaximumValue = 99999998 const val kSetupPINCodeUndefinedValue = 0 +const val kTotalPayloadDataSizeInBits: Int = + kVersionFieldLengthInBits + + kVendorIDFieldLengthInBits + + kProductIDFieldLengthInBits + + kCommissioningFlowFieldLengthInBits + + kRendezvousInfoFieldLengthInBits + + kPayloadDiscriminatorFieldLengthInBits + + kSetupPINCodeFieldLengthInBits + + kPaddingFieldLengthInBits + +const val kTotalPayloadDataSizeInBytes: Int = kTotalPayloadDataSizeInBits / 8 + +const val kQRCodePrefix = "MT:" + /** Class to hold the data from the scanned QR code or Manual Pairing Code. */ class OnboardingPayload( /** Version info of the OnboardingPayload: version SHALL be 0 */ @@ -102,711 +116,6 @@ class OnboardingPayload( ) { var optionalQRCodeInfo: HashMap - // code="0x0000" is defined as "Matter Standard" in the official CSA alliance manufacturer ID database - // and is treated as invalid in Matter SDK. - enum class VendorId(val value: Int) { - UNSPECIFIED(0x0000), - PANASONIC(0x0001), - SONY(0x0002), - SAMSUNG(0x0003), - PHILIPS(0x0004), - FREESCALE_RF(0x0005), - OKI_SEMICONDUCTORS(0x0006), - TEXAS_INSTRUMENTS(0x0007), - CIRRONET(0x1000), - CHIPCON(0x1001), - EMBER(0x1002), - NTS(0x1003), - FREESCALE(0x1004), - IP_COM(0x1005), - SAN_JUAN_SOFTWARE(0x1006), - TUV(0x1007), - INTEGRATION(0x1008), - BM_SPA(0x1009), - AWAREPOINT(0x100A), - SIGNIFY_NETHERLANDS(0x100B), - LUXOFT(0x100C), - KORWIN(0x100D), - ONE_RF_TECHNOLOGY(0x100E), - SOFTWARE_TECHNOLOGIES_GROUP(0x100F), - TELEGESIS(0x1010), - VISONIC(0x1011), - INSTA(0x1012), - ATALUM(0x1013), - ATMEL(0x1014), - DEVELCO(0x1015), - HONEYWELL(0x1016), - RADIOPULSE(0x1017), - RENESAS(0x1018), - XANADU_WIRELESS(0x1019), - NEC_ENGINEERING(0x101A), - YAMATAKE_CORPORATION(0x101B), - TENDRIL_NETWORKS(0x101C), - ASSA_ABLOY(0x101D), - MAXSTREAM(0x101E), - NEUROCOM(0x101F), - INSTITUTE_FOR_INFORMATION_INDUSTRY(0x1020), - LEGRAND_GROUP(0x1021), - ICONTROL(0x1022), - RAYMARINE(0x1023), - LS_RESEARCH(0x1024), - ONITY_INC(0x1025), - MONO_PRODUCTS(0x1026), - RF_TECHNOLOGIES(0x1027), - ITRON(0x1028), - TRITECH(0x1029), - EMBEDIT_AS(0x102A), - S3C(0x102B), - SIEMENS(0x102C), - MINDTECH(0x102D), - LG_ELECTRONICS(0x102E), - MITSUBISHI_ELECTRIC_CORP(0x102F), - JOHNSON_CONTROLS(0x1030), - SECURE_METERS_UK_LTD(0x1031), - KNICK(0x1032), - VICONICS(0x1033), - FLEXIPANEL(0x1034), - PIASIM_CORPORATION_PTE_LTD(0x1035), - TRANE(0x1036), - NXP_SEMICONDUCTORS(0x1037), - LIVING_INDEPENDENTLY_GROUP(0x1038), - ALERTME_COM(0x1039), - DAINTREE(0x103A), - AIJI_SYSTEM(0x103B), - TELECOM_ITALIA(0x103C), - MIKROKRETS_AS(0x103D), - OKI_SEMICONDUCTOR(0x103E), - NEWPORT_ELECTONICS(0x103F), - CONTROL_4(0x1040), - STMICROELECTRONICS(0x1041), - AD_SOL_NISSIN_CORP(0x1042), - DCSI(0x1043), - FRANCE_TELECOM(0x1044), - MUNET(0x1045), - AUTANI_CORPORATION(0x1046), - COLORADO_VNET(0x1047), - AEROCOMM_INC(0x1048), - SILICON_LABORATORIES(0x1049), - INNCOM_INTERNATIONAL_INC(0x104A), - COOPER_POWER_SYSTEMS(0x104B), - SYNAPSE(0x104C), - FISHER_PIERCE_SUNRISE(0x104D), - CENTRALITE_SYSTEMS_INC(0x104E), - CRANE_WIRELESS_MONITORING_SOLUTIONS(0x104F), - MOBILARM_LIMITED(0x1050), - IMONITOR_RESEARCH_LTD(0x1051), - BARTECH(0x1052), - MESHNETICS(0x1053), - LS_INDUSTRIAL_SYSTEMS(0x1054), - CASON_ENGINEERING(0x1055), - WIRELESS_GLUE_NETWORKS(0x1056), - ELSTER(0x1057), - SMS_TECNOLOGIA_ELETRONICA(0x1058), - ONSET_COMPUTER_CORPORATION(0x1059), - RIGA_DEVELOPMENT(0x105A), - ENERGATE(0x105B), - CONMED_LINVATEC(0x105C), - POWERMAND(0x105D), - SCHNEIDER_ELECTRIC(0x105E), - EATON_CORPORATION(0x105F), - TELULAR_CORPORATION(0x1060), - DELPHI_MEDICAL_SYSTEMS(0x1061), - EPISENSOR_LIMITED(0x1062), - LANDIS_GYR(0x1063), - KABA_GROUP(0x1064), - SHURE_INCORPORATED(0x1065), - COMVERGE_INC(0x1066), - DBS_LODGING_TECHNOLOGIES(0x1067), - ENERGY_AWARE_TECHNOLOGY(0x1068), - HIDALGO_LIMITED(0x1069), - AIR2APP(0x106A), - AMX(0x106B), - EDMI_PTY_LTD(0x106C), - CYAN_LTD(0x106D), - SYSTEM_SPA(0x106E), - TELIT(0x106F), - KAGA_ELECTRONICS(0x1070), - ASTREL_GROUP(0x1071), - CERTICOM(0x1072), - GRIDPOINT(0x1073), - PROFILE_SYSTEMS(0x1074), - COMPACTA_INTERNATIONAL(0x1075), - FREESTYLE_TECHNOLOGY(0x1076), - ALEKTRONA(0x1077), - COMPUTIME(0x1078), - REMOTE_TECHNOLOGIES_INC(0x1079), - WAVECOM_SA(0x107A), - ENERGY_OPTIMIZERS(0x107B), - GE(0x107C), - JETLUN(0x107D), - CIPHER_SYSTEMS(0x107E), - CORPORATE_SYSTEMS_ENGINEERING(0x107F), - ECOBEE(0x1080), - SMK(0x1081), - MESHWORKS_WIRELESS(0x1082), - ELLIPS_BV(0x1083), - SECURE_ELECTRANS(0x1084), - CEDO(0x1085), - TOSHIBA(0x1086), - DIGI_INTERNATIONAL(0x1087), - UBILogix(0x1088), - ECHELON(0x1089), - GREEN_ENERGY_OPTIONS(0x1090), - SILVER_SPRING_NETWORKS(0x1091), - BLACK_AND_DECKER(0x1092), - AZTECH_ASSOCIATES_INC(0x1093), - A_AND_D_CO_LTD(0x1094), - RAINFOREST_AUTOMATION(0x1095), - CARRIER_ELECTRONICS(0x1096), - SYCHIP_MURATA(0x1097), - OPENPEAK(0x1098), - PASSIVE_SYSTEMS(0x1099), - MMB_RESEARCH(0x109A), - LEVITON_MANUFACTURING_COMPANY(0x109B), - KOREA_ELECTRIC_POWER_DATA_NETWORK_CO(0x109C), - COMCAST(0x109D), - NEC_ELECTRONICS(0x109E), - NETVOX(0x109F), - U_CONTROL(0x10A0), - EMBEDIA_TECHNOLOGIES_CORP(0x10A1), - SENSUS(0x10A2), - SUNRISE_TECHNOLOGIES(0x10A3), - MEMTECH_CORP(0x10A4), - FREEBOX(0x10A5), - M2_LABS_LTD(0x10A6), - BRITISH_GAS(0x10A7), - SENTEC_LTD(0x10A8), - NAVETAS(0x10A9), - LIGHTSPEED_TECHNOLOGIES(0x10AA), - OKI_ELECTRIC_INDUSTRY_CO(0x10AB), - S_I_SISTEMAS_INTELIGENTES_ELETRONICOS(0x10AC), - DOMETIC(0x10AD), - ALPS(0x10AE), - ENERGYHUB(0x10AF), - KAMSTRUP(0x10B0), - ECHOSTAR(0x10B1), - ENERNOC(0x10B2), - ELTAV(0x10B3), - BELKIN(0x10B4), - XSTREAMHD_WIRELESS_VENTURES(0x10B5), - SATURN_SOUTH_PTY_LTD(0x10B6), - GREENTRAPOLINE_A_S(0x10B7), - SMARTSYNCH_INC(0x10B8), - NYCE_CONTROL_INC(0x10B9), - ICM_CONTROLS_CORP(0x10BA), - MILLENNIUM_ELECTRONICS_PTY_LTD(0x10BB), - MOTOROLA_INC(0x10BC), - EMERSON_WHITE_RODGERS(0x10BD), - RADIO_THERMOSTAT_COMPANY_OF_AMERICA(0x10BE), - OMRON_CORPORATION(0x10BF), - GIINII_GLOBAL_LIMITED(0x10C0), - FUJITSU_GENERAL_LIMITED(0x10C1), - PEEL_TECHNOLOGIES_INC(0x10C2), - ACCENT_SPA(0x10C3), - BYTESNAP_DESIGN_LTD(0x10C4), - NEC_TOKIN_CORPORATION(0x10C5), - G4S_JUSTICE_SERVICES(0x10C6), - TRILLIANT_NETWORKS_INC(0x10C7), - ELECTROLUX_ITALIA_SPA(0x10C8), - ONZO_LTD(0x10C9), - ENTEK_SYSTEMS(0x10CA), - MAINSTREAM_ENGINEERING(0x10CC), - INDESIT_COMPANY(0x10CD), - THINKECO_INC(0x10CE), - D2C_INC(0x10CF), - QORVO(0x10D0), - INTERCEL(0x10D1), - MITSUMI_ELECTRIC_CO_LTD(0x10D3), - MITSUMI_ELECTRIC_CO_LTD_2(0x10D4), - ZENTRUM_MIKROELEKTRONIK_DRESDEN_AG(0x10D5), - NEST_LABS_INC(0x10D6), - EXEGIN_TECHNOLOGIES_LTD(0x10D7), - TAKAHATA_PRECISION_CO(0x10D9), - SUMITOMO_ELECTRIC_NETWORKS_INC(0x10DA), - GE_ENERGY(0x10DB), - GE_APPLIANCES(0x10DC), - RADIOCRAFTS_AS(0x10DD), - CEIVA(0x10DE), - TEC_AND_CO_CO_LTD(0x10DF), - CHAMELEON_TECHNOLOGY_UK_LTD(0x10E0), - RUWIDO_AUSTRIA_GMBH(0x10E2), - HUAWEI_TECHNOLOGIES_CO(0x10E3), - HUAWEI_TECHNOLOGIES_CO_2(0x10E4), - GREENWAVE_REALITY(0x10E5), - BGLOBAL_METERING_LTD(0x10E6), - MINDTECK(0x10E7), - INGERSOLL_RAND(0x10E8), - DIUS_COMPUTING_PTY_LTD(0x10E9), - EMBEDDED_AUTOMATION_INC(0x10EA), - ABB(0x10EB), - GENUS_POWER_INFRASTRUCTURES_LIMITED(0x10ED), - UNIVERSAL_ELECTRONICS_INC(0x10EE), - UNIVERSAL_ELECTRONICS_INC_2(0x10EF), - METRUM_TECHNOLOGIES_LLC(0x10F0), - CISCO(0x10F1), - UBISYS_TECHNOLOGIES_GMBH(0x10F2), - CONSERT(0x10F3), - CRESTRON_ELECTRONICS(0x10F4), - ENPHASE_ENERGY(0x10F5), - INVENSYS_CONTROLS(0x10F6), - MUELLER_SYSTEMS_LLC(0x10F7), - AAC_TECHNOLOGIES_HOLDING(0x10F8), - U_NEXT_CO(0x10F9), - STEELCASE_INC(0x10FA), - TELEMATICS_WIRELESS(0x10FB), - SAMIL_POWER_CO(0x10FC), - PACE_PLC(0x10FD), - OSBORNE_COINAGE_CO(0x10FE), - POWERWATCH(0x10FF), - CANDELED_GMBH(0x1100), - FLEXGRID_SRL(0x1101), - HUMAX(0x1102), - UNIVERSAL_DEVICES(0x1103), - ADVANCED_ENERGY(0x1104), - BEGA_GANTENBRINK_LEUCHTEN(0x1105), - BRUNEL_UNIVERSITY(0x1106), - PANASONIC_RD_CENTER_SINGAPORE(0x1107), - ESYSTEMS_RESEARCH(0x1108), - PANAMAX(0x1109), - SMARTTHINGS_INC(0x110A), - EM_LITE_LTD(0x110B), - OSRAM_SYLVANIA(0x110C), - SAVE_ENERGY_LTD(0x110D), - PLANET_INNOVATION_PRODUCTS_PTY_LTD(0x110E), - AMBIENT_DEVICES_INC(0x110F), - PROFALUX(0x1110), - BILLION_ELECTRIC_COMPANY(0x1111), - EMBERTEC_PTY_LTD(0x1112), - IT_WATCHDOGS(0x1113), - RELOC(0x1114), - INTEL_CORPORATION(0x1115), - TREND_ELECTRONICS_LIMITED(0x1116), - MOXA(0x1117), - QEES(0x1118), - SAYME_WIRELESS_SENSOR_NETWORKS(0x1119), - PENTAIR_AQUATIC_SYSTEMS(0x111A), - ORBIT_IRRIGATION(0x111B), - CALIFORNIA_EASTERN_LABORATORIES(0x111C), - IDT_TECHNOLOGY_LIMITED(0x111E), - PIXELA_CORPORATION(0x111F), - TIVO_INC(0x1120), - FIDURE_CORP(0x1121), - MARVELL_SEMICONDUCTOR_INC(0x1122), - WASION_GROUP_LIMITED(0x1123), - JASCO_PRODUCTS_COMPANY(0x1124), - SHENZHEN_KAIFA_TECHNOLOGY(0x1125), - NETCOMM_WIRELESS_LIMITED(0x1126), - DEFINE_INSTRUMENTS_LIMITED(0x1127), - IN_HOME_DISPLAYS_LTD(0x1128), - MIELE_AND_CIE_KG(0x1129), - TELEVES_SA(0x112A), - LABELEC(0x112B), - CHINA_ELECTRONICS_STANDARDIZATION_INSTITUTE(0x112C), - VECTORFORM_LLC(0x112D), - BUSCH_JAEGER_ELEKTRO(0x112E), - REDPINE_SIGNALS_INC(0x112F), - BRIDGES_ELECTRONIC_TECHNOLOGY_PTY_LTD(0x1130), - SERCOMM(0x1131), - WSH_GMBH_WIRSINDHELLER(0x1132), - BOSCH_SECURITY_SYSTEMS_INC(0x1133), - EZEX_CORPORATION(0x1134), - DRESDEN_ELEKTRONIK_INGENIEURTECHNIK_GMBH(0x1135), - MEAZON_SA(0x1136), - CROW_ELECTRONIC_ENGINEERING_LTD(0x1137), - HARVARD_ENGINEERING_PLC(0x1138), - ANDSON_BEIJING_TECHNOLOGY(0x1139), - ADHOCO_AG(0x113A), - WAXMAN_CONSUMER_PRODUCTS_GROUP_INC(0x113B), - OWON_TECHNOLOGY_INC(0x113C), - HITRON_TECHNOLOGIES_INC(0x113D), - SCEMTEC_HARD_UND_SOFTWARE(0x113E), - WEBEE_LLC(0x113F), - GRID2HOME_INC(0x1140), - TELINK_MICRO(0x1141), - JASMINE_SYSTEMS_INC(0x1142), - BIDGELY(0x1143), - LUTRON(0x1144), - IJENKO(0x1145), - STARFIELD_ELECTRONIC_LTD(0x1146), - TCP_INC(0x1147), - ROGERS_COMMUNICATIONS_PARTNERSHIP(0x1148), - CREE_INC(0x1149), - ROBERT_BOSCH_LLC(0x114A), - IBIS_NETWORKS_INC(0x114B), - QUIRKY_INC(0x114C), - EFERGY_TECHNOLOGIES_LIMITED(0x114D), - SMARTLABS_INC(0x114E), - EVERSPRING_INDUSTRY_CO_LTD(0x114F), - SWANN_COMMUNICATIONS_PTL_LTD(0x1150), - SONETER(0x1151), - SAMSUNG_SDS(0x1152), - UNIBAND_ELECTRONIC_CORPORATION(0x1153), - ACCTON_TECHNOLOGY_CORPORATION(0x1154), - BOSCH_THERMOTECHNIK_GMBH(0x1155), - WINCOR_NIXDORF_INC(0x1156), - OHSUNG_ELECTRONICS(0x1157), - ZEN_WITHIN_INC(0x1158), - TECH4HOME_LDA(0x1159), - NANOLEAF(0x115A), - KEEN_HOME_INC(0x115B), - POLY_CONTROL_APS(0x115C), - EASTFIELD_LIGHTING_CO_LTD_SHENZHEN(0x115D), - IP_DATATEL_INC(0x115E), - LUMI_UNITED_TECHOLOGY_LTD_SHENZHEN(0x115F), - SENGLED_CO_LTD(0x1160), - REMOTE_SOLUTION_CO_LTD(0x1161), - ABB_GENWAY_XIAMEN_ELECTRICAL_EQUIPMENT_CO(0x1162), - ZHEJIANG_REXENSE_TECH(0x1163), - FOREE_TECHNOLOGY(0x1164), - OPEN_ACCESS_TECHNOLOGY_INTL(0x1165), - INNR_LIGHTING_BV(0x1166), - TECHWORLD_INDUSTRIES(0x1167), - LEEDARSON_LIGHTING_CO_LTD(0x1168), - ARZEL_ZONING(0x1169), - HOLLEY_TECHNOLOGY(0x116A), - BELDON_TECHNOLOGIES(0x116B), - FLEXTRONICS(0x116C), - SHENZHEN_MEIAN(0x116D), - LOWES(0x116E), - SIGMA_CONNECTIVITY(0x116F), - WULIAN(0x1171), - PLUGWISE_BV(0x1172), - TITAN_PRODUCTS(0x1173), - ECOSPECTRAL(0x1174), - D_LINK(0x1175), - TECHNICOLOR_HOME_USA(0x1176), - OPPLE_LIGHTING(0x1177), - WISTRON_NEWEB_CORP(0x1178), - QMOTION_SHADES(0x1179), - INSTA_GMBH(0x117A), - SHANGHAI_VANCOUNT(0x117B), - IKEA_OF_SWEDEN(0x117C), - RT_RK(0x117D), - SHENZHEN_FEIBIT(0x117E), - EUCONTROLS(0x117F), - TELKONET(0x1180), - THERMAL_SOLUTION_RESOURCES(0x1181), - POMCUBE(0x1182), - EI_ELECTRONICS(0x1183), - OPTOGA(0x1184), - STELPRO(0x1185), - LYNXUS_TECHNOLOGIES_CORP(0x1186), - SEMICONDUCTOR_COMPONENTS(0x1187), - TP_LINK(0x1188), - LEDVANCE_GMBH(0x1189), - NORTEK(0x118A), - IREVO_ASSA_ABBLOY_KOREA(0x118B), - MIDEA(0x118C), - ZF_FRIEDRICHSHAFEN(0x118D), - CHECKIT(0x118E), - ACLARA(0x118F), - NOKIA(0x1190), - GOLDCARD_HIGH_TECH_CO(0x1191), - GEORGE_WILSON_INDUSTRIES_LTD(0x1192), - EASY_SAVER_CO_INC(0x1193), - ZTE_CORPORATION(0x1194), - ARRIS(0x1195), - RELIANCE_BIG_TV(0x1196), - INSIGHT_ENERGY_VENTURES_POWERLEY(0x1197), - THOMAS_RESEARCH_PRODUCTS(0x1198), - LI_SENG_TECHNOLOGY(0x1199), - SYSTEM_LEVEL_SOLUTIONS_INC(0x119A), - MATRIX_LABS(0x119B), - SINOPE_TECHNOLOGIES(0x119C), - JIUZHOU_GREEBLE(0x119D), - GUANGZHOU_LANVEE_TECH_CO_LTD(0x119E), - VENSTAR(0x119F), - SLV(0x1200), - HALO_SMART_LABS(0x1201), - SCOUT_SECURITY_INC(0x1202), - ALIBABA_CHINA_INC(0x1203), - RESOLUTION_PRODUCTS_INC(0x1204), - SMARTLOK_INC(0x1205), - LUX_PRODUCTS_CORP(0x1206), - VIMAR_SPA(0x1207), - UNIVERSAL_LIGHTING_TECHNOLOGIES(0x1208), - ROBERT_BOSCH_GMBH(0x1209), - ACCENTURE(0x120A), - HEIMAN_TECHNOLOGY_CO(0x120B), - SHENZHEN_HOMA_TECHNOLOGY_CO(0x120C), - VISION_ELECTRONICS_TECHNOLOGY(0x120D), - LENOVO(0x120E), - PRESCIENSE_RD(0x120F), - SHENZHEN_SEASTAR_INTELLIGENCE_CO(0x1210), - SENSATIVE_AB(0x1211), - SOLAREDGE(0x1212), - ZIPATO(0x1213), - CHINA_FIRE_SECURITY_SENSING_MANUFACTURING(0x1214), - QUBY_BV(0x1215), - HANGZHOU_ROOMBANKER_TECHNOLOGY_CO(0x1216), - AMAZON_LAB126(0x1217), - PAULMANN_LICHT_GMBH(0x1218), - SHENZHEN_ORVIBO_ELECTRONICS_CO_LTD(0x1219), - TCI_TELECOMMUNICATIONS(0x121A), - MUELLER_LICHT_INTERNATIONAL_INC(0x121B), - AURORA_LIMITED(0x121C), - SMARTDCC(0x121D), - SHANGHAI_UMEINFO_CO_LTD(0x121E), - CARBONTRACK(0x121F), - SOMFY(0x1220), - VIESSMANN_ELEKTRONIK_GMBH(0x1221), - HILDEBRAND_TECHNOLOGY_LTD(0x1222), - ONKYO_TECHNOLOGY_CORPORATION(0x1223), - SHENZHEN_SUNRICHER_TECHNOLOGY_LTD(0x1224), - XIU_XIU_TECHNOLOGY_CO_LTD(0x1225), - ZUMTOBEL_GROUP(0x1226), - SHENZHEN_KAADAS_INTELLIGENT_TECHNOLOGY_CO_LTD(0x1227), - SHANGHAI_XIAOYAN_TECHNOLOGY_CO_LTD(0x1228), - CYPRESS_SEMICONDUCTOR(0x1229), - XAL_GMBH(0x122A), - INERGY_SYSTEMS_LLC(0x122B), - ALFRED_KARCHER_GMBH_CO_KG(0x122C), - ADUROLIGHT_MANUFACTURING(0x122D), - GROUPE_MULLER(0x122E), - V_MARK_ENTERPRISES_INC(0x122F), - LEAD_ENERGY_AG(0x1230), - ULTIMATE_IOT_HENAN_TECHNOLOGY_LTD(0x1231), - AXXESS_INDUSTRIES_INC(0x1232), - THIRD_REALITY_INC(0x1233), - DSR_CORPORATION(0x1234), - GUANGZHOU_VENSI_INTELLIGENT_TECHNOLOGY(0x1235), - SCHLAGE_LOCK_ALLEGION(0x1236), - NET2GRID(0x1237), - AIRAM_ELECTRIC_OY_AB(0x1238), - IMMAX_WPB_CZ(0x1239), - ZIV_AUTOMATION(0x123A), - HANGZHOU_IMAGICTECHNOLOGY(0x123B), - XIAMEN_LEELEN_TECHNOLOGY(0x123C), - OVERKIZ_SAS(0x123D), - FLONIDAN_A_S(0x123E), - HDL_AUTOMATION(0x123F), - ARDOMUS_NETWORKS_CORPORATION(0x1240), - SAMJIN_CO_LTD(0x1241), - FIREANGEL_SAFETY_TECHNOLOGY(0x1242), - INDRA_SISTEMAS_SA(0x1243), - SHENZHEN_JBT_SMART_LIGHTING(0x1244), - GE_LIGHTING_CURRENT(0x1245), - DANFOSS_A_S(0x1246), - NIVISS_PHP_SP_Z_O_O_SP_K(0x1247), - SHENZHEN_FENGLIYUAN_ENERGY_CONSERVATING_TECHNOLOGY(0x1248), - NEXELEC(0x1249), - SICHUAN_BEHOME_PROMINENT_TECHNOLOGY(0x124A), - FUJIAN_STAR_NET_COMMUNICATION(0x124B), - TOSHIBA_VISUAL_SOLUTIONS_CORPORATION(0x124C), - LATCHABLE_INC(0x124D), - L_S_DEUTSCHLAND_GMBH(0x124E), - GLEDOPTO_CO_LTD(0x124F), - THE_HOME_DEPOT(0x1250), - NEONLITE_DISTRIBUTION_LIMITED(0x1251), - ARLO_TECHNOLOGIES_INC(0x1252), - XINGLUO_TECHNOLOGY_CO_LTD(0x1253), - SIMON_ELECTRIC_CHINA_CO_LTD(0x1254), - HANGZHOU_GREATSTAR_INDUSTRIAL_CO_LTD(0x1255), - SEQUENTRIC_ENERGY_SYSTEMS_LLC(0x1256), - SOLUM_CO_LTD(0x1257), - EAGLERISE_ELECTRIC_ELECTRONIC_CHINA_CO_LTD(0x1258), - FANTEM_TECHNOLOGIES_SHENZHEN_CO_LTD(0x1259), - YUNDING_NETWORK_TECHNOLOGY_BEIJING_CO_LTD(0x125A), - ATLANTIC_GROUP(0x125B), - XIAMEN_INTRETECH_INC(0x125C), - TUYA_GLOBAL_INC(0x125D), - DNAKE_XIAMEN_INTELLIGENT_TECHNOLOGY(0x125E), - NIKO_NV(0x125F), - EMPORIA_ENERGY(0x1260), - SIKOM_AS(0x1261), - AXIS_LABS_INC(0x1262), - CURRENT_PRODUCTS_CORPORATION(0x1263), - METERSIT_SRL(0x1264), - HORNBACH_BAUMARKT_AG(0x1265), - DICEWORLD_S_R_L_A_SOCIO_UNICO(0x1266), - ARC_TECHNOLOGY_CO_LTD(0x1267), - HANGZHOU_KONKE_INFORMATION_TECHNOLOGY(0x1268), - SALTO_SYSTEMS_SL(0x1269), - SHENZHEN_SHYUGJ_TECHNOLOGY(0x126A), - BRAYDEN_AUTOMATION_CORPORATION(0x126B), - ENVIRONEXUS_PTY_LTD(0x126C), - ELTRA_NV_SA(0x126D), - XIAOMI_COMMUNICATIONS_CO_LTD(0x126E), - SHANGHAI_SHUNCOM_ELECTRONIC_TECHNOLOGY(0x126F), - VOLTALIS_SA(0x1270), - FEELUX_CO_LTD(0x1271), - SMARTPLUS_INC(0x1272), - HALEMEIER_GMBH(0x1273), - TRUST_INTERNATIONAL_BV(0x1274), - DUKE_ENERGY_BUSINESS_SERVICES_LLC(0x1275), - CALIX_INC(0x1276), - ADEO(0x1277), - CONNECTED_RESPONSE_LIMITED(0x1278), - STROYENERGOKOM_LTD(0x1279), - LUMITECH_LIGHTING_SOLUTION_GMBH(0x127A), - VERDANT_ENVIRONMENTAL_TECHNOLOGIES(0x127B), - ALFRED_INTERNATIONAL_INC(0x127C), - ANSI_LED_LIGHTING_CO_LTD(0x127D), - MINDTREE_LIMITED(0x127E), - NORDIC_SEMICONDUCTOR_ASA(0x127F), - SITERWELL_ELECTRONICS_CO_LIMITED(0x1280), - BRILONER_LEUCHTEN_GMBH(0x1281), - SHENZHEN_SEI_TECHNOLOGY_CO_LTD(0x1282), - COPPER_LABS_INC(0x1283), - DELTA_DORE(0x1284), - HAGER_GROUP(0x1285), - SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD(0x1286), - HANGZHOU_SKY_LIGHTING_CO_LTD(0x1287), - E_ON_SE(0x1288), - LIDL_STIFTUNG_CO_KG(0x1289), - SICHUAN_CHANGHONG_NETWORK_TECHNOLOGIES(0x128A), - NODON(0x128B), - JIANGXI_INNOTECH_TECHNOLOGY_CO_LTD(0x128C), - MERCATOR_PTY_LTD(0x128D), - BEIJING_RUYING_TECH_LIMITED(0x128E), - EGLO_LEUCHTEN_GMBH(0x128F), - PIETRO_FIORENTINI_SPA(0x1290), - ZEHNDER_GROUP_VAUX_ANDIGNY(0x1291), - BRK_BRANDS_INC(0x1292), - ASKEY_COMPUTER_CORP(0x1293), - PASSIVEBOLT_INC(0x1294), - AVM_AUDIOVISUELLES_MARKETING_UND_COMPUTERSYSTEME_BERLIN(0x1295), - NINGBO_SUNTECH_LIGHTING_TECHNOLOGY_CO_LTD(0x1296), - SOCIETE_EN_COMMANDITE_STELLO(0x1297), - VIVINT_SMART_HOME(0x1298), - NAMRON_AS(0x1299), - RADEMACHER_GERATE_ELEKTRONIK_GMBH(0x129A), - OMO_SYSTEMS_LTD(0x129B), - SIGLIS_AG(0x129C), - IMHOTEP_CREATION(0x129D), - ICASA(0x129E), - LEVEL_HOME_INC(0x129F), - TIS_CONTROL_LIMITED(0x1300), - RADISYS_INDIA_PVT_LTD(0x1301), - VEEA_INC(0x1302), - FELL_TECHNOLOGY_AS(0x1303), - SOWILO_DESIGN_SERVICES_LTD(0x1304), - LEXI_DEVICES_INC(0x1305), - LIFI_LABS_INC_DBA_LIFX(0x1306), - GRUNDFOS_HOLDING_AS(0x1307), - SOURCING_AND_CREATION(0x1308), - KRAKEN_TECHNOLOGIES_LTD(0x1309), - EVE_SYSTEMS(0x130A), - LITE_ON_TECHNOLOGY_CORPORATION(0x130B), - FOCALCREST_LIMITED(0x130C), - BOUFFALO_LAB_NANJING_CO_LTD(0x130D), - WYZE_LABS_INC(0x130E), - Z_WAVE_EUROPE_GMBH(0x130F), - AEOTEC_LIMITED(0x1310), - NGSTB_COMPANY_LIMITED(0x1311), - QINGDAO_YEELINK_INFORMATION_TECHNOLOGY_CO_LTD(0x1312), - E_SMART_HOME_AUTOMATION_SYSTEMS_LIMITED(0x1313), - FIBAR_GROUP_SA(0x1314), - PROLITECH_GMBH(0x1315), - PANKORE_INTEGRATED_CIRCUIT_TECHNOLOGY_CO_LTD(0x1316), - LOGITECH(0x1317), - PIARO_INC(0x1318), - MITSUBISHI_ELECTRIC_US_INC(0x1319), - RESIDEO_TECHNOLOGIES_INC(0x131A), - ESPRESSIF_SYSTEMS_SHANGHAI_CO_LTD(0x131B), - HELLA_SONNEN_UND_WETTERSCHUTZTECHNIK_GMBH(0x131C), - GEBERIT_INTERNATIONAL_AG(0x131D), - CAME_SPA(0x131E), - GUANGZHOU_ELITE_EDUCATION_AND_TECHNOLOGY_CO_LTD(0x131F), - PHYPLUS_MICROELECTRONICS_LIMITED(0x1320), - SHENZHEN_SONOFF_TECHNOLOGIES_CO_LTD(0x1321), - SAFE4_SECURITY_GROUP(0x1322), - SHANGHAI_MXCHIP_INFORMATION_TECHNOLOGY_CO_LTD(0x1323), - HDC_I_CONTROLS(0x1324), - ZUMA_ARRAY_LIMITED(0x1325), - DECELECT(0x1326), - MILL_INTERNATIONAL_AS(0x1327), - HOMEWIZARD_BV(0x1328), - SHENZHEN_TOPBAND_CO(0x1329), - PRESSAC_COMMUNICATIONS_LTD(0x132A), - ORIGIN_WIRELESS_INC(0x132B), - CONNECTE_AS(0x132C), - YOKIS(0x132D), - XIAMEN_YANKON_ENERGETIC_LIGHTING_CO(0x132E), - YANDEX_LLC(0x132F), - CRITICAL_SOFTWARE_SA(0x1330), - NORTEK_CONTROL(0x1331), - BRIGHTAI(0x1332), - BECKER_ANTRIEBE_GMBH(0x1333), - SHENZHEN_TCL_NEW_TECHNOLOGY_COMPANY_LIMITED(0x1334), - DEXATEK_TECHNOLOGY_LTD(0x1335), - ELELABS_INTERNATIONAL_LIMITED(0x1336), - DATEK_WIRELESS_AS(0x1337), - ALDES(0x1338), - SAVANT_COMPANY(0x1339), - ARISTON_THERMO_GROUP(0x133A), - WAREMA_RENKHOFF_SE(0x133B), - VTECH_HOLDINGS_LIMITED(0x133C), - FUTUREHOME_AS(0x133D), - COGNITIVE_SYSTEMS_CORP(0x133E), - ASR_MICROELECTRONICS_SHENZHEN_CO(0x133F), - AIRIOS(0x1340), - GUANGDONG_OPPO_MOBILE_TELECOMMUNICATIONS_CORP(0x1341), - BEKEN_CORPORATION(0x1342), - CORSAIR(0x1343), - ELTAKO_GMBH(0x1344), - CHENGDU_MEROSS_TECHNOLOGY_CO(0x1345), - RAFAEL_MICROELECTRONICS_INC(0x1346), - AUG_WINKHUAS_GMBH_AND_CO_KG(0x1347), - QINGDAO_HAIER_TECHNOLOGY_CO(0x1348), - APPLE_INC(0x1349), - ROLLEASE_ACME(0x134A), - NABU_CASA_INC(0x134B), - SIMON_HOLDING(0x134C), - KD_NAVIEN(0x134D), - TADO_GMBH(0x134E), - MEDIOLA_CONNECTED_LIVING_AG(0x134F), - POLYNHOME(0x1350), - HOORII_TECHNOLOGY_CO(0x1351), - KIMIN_ELECTRONICS_CO(0x1353), - ZYAX_AB(0x1354), - BARACODA_SA(0x1355), - LENNOX_INTERNATIONAL_INC(0x1356), - TELEDACTICS_INCORPORATED(0x1357), - TOP_VICTORY_INVESTMENTS_LIMITED(0x1358), - GOQUAL_INC(0x1359), - SIEGENIA_AUBI_KG(0x135A), - VIRTUAL_CONNECTED_CONTROLLING_SYSTEM_SINGAPORE_PTE_LTD(0x135B), - GIGASET_COMMUNICATIONS_GMBH(0x135C), - NUKI_HOME_SOLUTIONS_GMBH(0x135D), - DEVICEBOOK_INC(0x135E), - CONSUMER_2_INC_RENTLY(0x135F), - EDISON_LABS_INC_ORRO(0x1360), - INOVELLI(0x1361), - DEVERITEC_GMBH(0x1362), - CHARTER_COMMUNICATIONS(0x1363), - MONOLITHIC_POWER_SYSTEMS_INC(0x1364), - NINGBO_DOOYA_MECHANIC_AND_ELECTRONIC_TECHNOLOGY_CO(0x1365), - SHENZHEN_SDMC_TECHNOLOGY_CO(0x1366), - HP_INC(0x1367), - MUI_LAB_INC(0x1368), - BHTRONICS_SRL(0x1369), - AKUVOX_XIAMEN_NETWORKS_CO(0x136A), - GEWISS_SPA(0x1994), - CLIMAX_TECHNOLOGY_CO(0x2794), - GOOGLE_LLC(0x6006), - CONNECTIVITY_STANDARDS_ALLIANCE_1(0xC5A0), - CONNECTIVITY_STANDARDS_ALLIANCE_2(0xC5A1), - CONNECTIVITY_STANDARDS_ALLIANCE_3(0xC5A2), - CONNECTIVITY_STANDARDS_ALLIANCE_4(0xC5A3), - CONNECTIVITY_STANDARDS_ALLIANCE_5(0xC5A4), - CONNECTIVITY_STANDARDS_ALLIANCE_6(0xC5A5), - CONNECTIVITY_STANDARDS_ALLIANCE_7(0xC5A6), - CONNECTIVITY_STANDARDS_ALLIANCE_8(0xC5A7), - CONNECTIVITY_STANDARDS_ALLIANCE_9(0xC5A8), - CONNECTIVITY_STANDARDS_ALLIANCE_10(0xC5A9), - CONNECTIVITY_STANDARDS_ALLIANCE_11(0xC5AA), - CONNECTIVITY_STANDARDS_ALLIANCE_12(0xC5AB), - CONNECTIVITY_STANDARDS_ALLIANCE_13(0xC5AC), - CONNECTIVITY_STANDARDS_ALLIANCE_14(0xC5AD), - CONNECTIVITY_STANDARDS_ALLIANCE_15(0xC5AE), - CONNECTIVITY_STANDARDS_ALLIANCE_16(0xC5AF), - TESTVENDOR1(0xFFF1), - TESTVENDOR2(0xFFF2), - TESTVENDOR3(0xFFF3), - TESTVENDOR4(0xFFF4), - } - init { optionalQRCodeInfo = HashMap() } diff --git a/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt b/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt index a15753faf80b6c..8f5a02ed631db5 100644 --- a/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt +++ b/src/controller/java/src/chip/onboardingpayload/OptionalQRCodeInfo.kt @@ -17,18 +17,18 @@ package chip.onboardingpayload +enum class OptionalQRCodeInfoType { + TYPE_UNKNOWN, + TYPE_STRING, + TYPE_INT32, + TYPE_INT64, + TYPE_UINT32, + TYPE_UINT64 +} + data class OptionalQRCodeInfo( var tag: Int = 0, var type: OptionalQRCodeInfoType = OptionalQRCodeInfoType.TYPE_UNKNOWN, var data: String? = null, var int32: Int = 0 -) { - enum class OptionalQRCodeInfoType { - TYPE_UNKNOWN, - TYPE_STRING, - TYPE_INT32, - TYPE_INT64, - TYPE_UINT32, - TYPE_UINT64 - } -} +) diff --git a/src/controller/java/src/chip/onboardingpayload/VendorId.kt b/src/controller/java/src/chip/onboardingpayload/VendorId.kt new file mode 100644 index 00000000000000..e191d0c7f75e87 --- /dev/null +++ b/src/controller/java/src/chip/onboardingpayload/VendorId.kt @@ -0,0 +1,726 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package chip.onboardingpayload + +/** + * code="0x0000" is defined as "Matter Standard" in the official CSA alliance manufacturer ID database + * and is treated as invalid in Matter SDK. + */ +enum class VendorId(val value: Int) { + UNSPECIFIED(0x0000), + PANASONIC(0x0001), + SONY(0x0002), + SAMSUNG(0x0003), + PHILIPS(0x0004), + FREESCALE_RF(0x0005), + OKI_SEMICONDUCTORS(0x0006), + TEXAS_INSTRUMENTS(0x0007), + CIRRONET(0x1000), + CHIPCON(0x1001), + EMBER(0x1002), + NTS(0x1003), + FREESCALE(0x1004), + IP_COM(0x1005), + SAN_JUAN_SOFTWARE(0x1006), + TUV(0x1007), + INTEGRATION(0x1008), + BM_SPA(0x1009), + AWAREPOINT(0x100A), + SIGNIFY_NETHERLANDS(0x100B), + LUXOFT(0x100C), + KORWIN(0x100D), + ONE_RF_TECHNOLOGY(0x100E), + SOFTWARE_TECHNOLOGIES_GROUP(0x100F), + TELEGESIS(0x1010), + VISONIC(0x1011), + INSTA(0x1012), + ATALUM(0x1013), + ATMEL(0x1014), + DEVELCO(0x1015), + HONEYWELL(0x1016), + RADIOPULSE(0x1017), + RENESAS(0x1018), + XANADU_WIRELESS(0x1019), + NEC_ENGINEERING(0x101A), + YAMATAKE_CORPORATION(0x101B), + TENDRIL_NETWORKS(0x101C), + ASSA_ABLOY(0x101D), + MAXSTREAM(0x101E), + NEUROCOM(0x101F), + INSTITUTE_FOR_INFORMATION_INDUSTRY(0x1020), + LEGRAND_GROUP(0x1021), + ICONTROL(0x1022), + RAYMARINE(0x1023), + LS_RESEARCH(0x1024), + ONITY_INC(0x1025), + MONO_PRODUCTS(0x1026), + RF_TECHNOLOGIES(0x1027), + ITRON(0x1028), + TRITECH(0x1029), + EMBEDIT_AS(0x102A), + S3C(0x102B), + SIEMENS(0x102C), + MINDTECH(0x102D), + LG_ELECTRONICS(0x102E), + MITSUBISHI_ELECTRIC_CORP(0x102F), + JOHNSON_CONTROLS(0x1030), + SECURE_METERS_UK_LTD(0x1031), + KNICK(0x1032), + VICONICS(0x1033), + FLEXIPANEL(0x1034), + PIASIM_CORPORATION_PTE_LTD(0x1035), + TRANE(0x1036), + NXP_SEMICONDUCTORS(0x1037), + LIVING_INDEPENDENTLY_GROUP(0x1038), + ALERTME_COM(0x1039), + DAINTREE(0x103A), + AIJI_SYSTEM(0x103B), + TELECOM_ITALIA(0x103C), + MIKROKRETS_AS(0x103D), + OKI_SEMICONDUCTOR(0x103E), + NEWPORT_ELECTONICS(0x103F), + CONTROL_4(0x1040), + STMICROELECTRONICS(0x1041), + AD_SOL_NISSIN_CORP(0x1042), + DCSI(0x1043), + FRANCE_TELECOM(0x1044), + MUNET(0x1045), + AUTANI_CORPORATION(0x1046), + COLORADO_VNET(0x1047), + AEROCOMM_INC(0x1048), + SILICON_LABORATORIES(0x1049), + INNCOM_INTERNATIONAL_INC(0x104A), + COOPER_POWER_SYSTEMS(0x104B), + SYNAPSE(0x104C), + FISHER_PIERCE_SUNRISE(0x104D), + CENTRALITE_SYSTEMS_INC(0x104E), + CRANE_WIRELESS_MONITORING_SOLUTIONS(0x104F), + MOBILARM_LIMITED(0x1050), + IMONITOR_RESEARCH_LTD(0x1051), + BARTECH(0x1052), + MESHNETICS(0x1053), + LS_INDUSTRIAL_SYSTEMS(0x1054), + CASON_ENGINEERING(0x1055), + WIRELESS_GLUE_NETWORKS(0x1056), + ELSTER(0x1057), + SMS_TECNOLOGIA_ELETRONICA(0x1058), + ONSET_COMPUTER_CORPORATION(0x1059), + RIGA_DEVELOPMENT(0x105A), + ENERGATE(0x105B), + CONMED_LINVATEC(0x105C), + POWERMAND(0x105D), + SCHNEIDER_ELECTRIC(0x105E), + EATON_CORPORATION(0x105F), + TELULAR_CORPORATION(0x1060), + DELPHI_MEDICAL_SYSTEMS(0x1061), + EPISENSOR_LIMITED(0x1062), + LANDIS_GYR(0x1063), + KABA_GROUP(0x1064), + SHURE_INCORPORATED(0x1065), + COMVERGE_INC(0x1066), + DBS_LODGING_TECHNOLOGIES(0x1067), + ENERGY_AWARE_TECHNOLOGY(0x1068), + HIDALGO_LIMITED(0x1069), + AIR2APP(0x106A), + AMX(0x106B), + EDMI_PTY_LTD(0x106C), + CYAN_LTD(0x106D), + SYSTEM_SPA(0x106E), + TELIT(0x106F), + KAGA_ELECTRONICS(0x1070), + ASTREL_GROUP(0x1071), + CERTICOM(0x1072), + GRIDPOINT(0x1073), + PROFILE_SYSTEMS(0x1074), + COMPACTA_INTERNATIONAL(0x1075), + FREESTYLE_TECHNOLOGY(0x1076), + ALEKTRONA(0x1077), + COMPUTIME(0x1078), + REMOTE_TECHNOLOGIES_INC(0x1079), + WAVECOM_SA(0x107A), + ENERGY_OPTIMIZERS(0x107B), + GE(0x107C), + JETLUN(0x107D), + CIPHER_SYSTEMS(0x107E), + CORPORATE_SYSTEMS_ENGINEERING(0x107F), + ECOBEE(0x1080), + SMK(0x1081), + MESHWORKS_WIRELESS(0x1082), + ELLIPS_BV(0x1083), + SECURE_ELECTRANS(0x1084), + CEDO(0x1085), + TOSHIBA(0x1086), + DIGI_INTERNATIONAL(0x1087), + UBILogix(0x1088), + ECHELON(0x1089), + GREEN_ENERGY_OPTIONS(0x1090), + SILVER_SPRING_NETWORKS(0x1091), + BLACK_AND_DECKER(0x1092), + AZTECH_ASSOCIATES_INC(0x1093), + A_AND_D_CO_LTD(0x1094), + RAINFOREST_AUTOMATION(0x1095), + CARRIER_ELECTRONICS(0x1096), + SYCHIP_MURATA(0x1097), + OPENPEAK(0x1098), + PASSIVE_SYSTEMS(0x1099), + MMB_RESEARCH(0x109A), + LEVITON_MANUFACTURING_COMPANY(0x109B), + KOREA_ELECTRIC_POWER_DATA_NETWORK_CO(0x109C), + COMCAST(0x109D), + NEC_ELECTRONICS(0x109E), + NETVOX(0x109F), + U_CONTROL(0x10A0), + EMBEDIA_TECHNOLOGIES_CORP(0x10A1), + SENSUS(0x10A2), + SUNRISE_TECHNOLOGIES(0x10A3), + MEMTECH_CORP(0x10A4), + FREEBOX(0x10A5), + M2_LABS_LTD(0x10A6), + BRITISH_GAS(0x10A7), + SENTEC_LTD(0x10A8), + NAVETAS(0x10A9), + LIGHTSPEED_TECHNOLOGIES(0x10AA), + OKI_ELECTRIC_INDUSTRY_CO(0x10AB), + S_I_SISTEMAS_INTELIGENTES_ELETRONICOS(0x10AC), + DOMETIC(0x10AD), + ALPS(0x10AE), + ENERGYHUB(0x10AF), + KAMSTRUP(0x10B0), + ECHOSTAR(0x10B1), + ENERNOC(0x10B2), + ELTAV(0x10B3), + BELKIN(0x10B4), + XSTREAMHD_WIRELESS_VENTURES(0x10B5), + SATURN_SOUTH_PTY_LTD(0x10B6), + GREENTRAPOLINE_A_S(0x10B7), + SMARTSYNCH_INC(0x10B8), + NYCE_CONTROL_INC(0x10B9), + ICM_CONTROLS_CORP(0x10BA), + MILLENNIUM_ELECTRONICS_PTY_LTD(0x10BB), + MOTOROLA_INC(0x10BC), + EMERSON_WHITE_RODGERS(0x10BD), + RADIO_THERMOSTAT_COMPANY_OF_AMERICA(0x10BE), + OMRON_CORPORATION(0x10BF), + GIINII_GLOBAL_LIMITED(0x10C0), + FUJITSU_GENERAL_LIMITED(0x10C1), + PEEL_TECHNOLOGIES_INC(0x10C2), + ACCENT_SPA(0x10C3), + BYTESNAP_DESIGN_LTD(0x10C4), + NEC_TOKIN_CORPORATION(0x10C5), + G4S_JUSTICE_SERVICES(0x10C6), + TRILLIANT_NETWORKS_INC(0x10C7), + ELECTROLUX_ITALIA_SPA(0x10C8), + ONZO_LTD(0x10C9), + ENTEK_SYSTEMS(0x10CA), + MAINSTREAM_ENGINEERING(0x10CC), + INDESIT_COMPANY(0x10CD), + THINKECO_INC(0x10CE), + D2C_INC(0x10CF), + QORVO(0x10D0), + INTERCEL(0x10D1), + MITSUMI_ELECTRIC_CO_LTD(0x10D3), + MITSUMI_ELECTRIC_CO_LTD_2(0x10D4), + ZENTRUM_MIKROELEKTRONIK_DRESDEN_AG(0x10D5), + NEST_LABS_INC(0x10D6), + EXEGIN_TECHNOLOGIES_LTD(0x10D7), + TAKAHATA_PRECISION_CO(0x10D9), + SUMITOMO_ELECTRIC_NETWORKS_INC(0x10DA), + GE_ENERGY(0x10DB), + GE_APPLIANCES(0x10DC), + RADIOCRAFTS_AS(0x10DD), + CEIVA(0x10DE), + TEC_AND_CO_CO_LTD(0x10DF), + CHAMELEON_TECHNOLOGY_UK_LTD(0x10E0), + RUWIDO_AUSTRIA_GMBH(0x10E2), + HUAWEI_TECHNOLOGIES_CO(0x10E3), + HUAWEI_TECHNOLOGIES_CO_2(0x10E4), + GREENWAVE_REALITY(0x10E5), + BGLOBAL_METERING_LTD(0x10E6), + MINDTECK(0x10E7), + INGERSOLL_RAND(0x10E8), + DIUS_COMPUTING_PTY_LTD(0x10E9), + EMBEDDED_AUTOMATION_INC(0x10EA), + ABB(0x10EB), + GENUS_POWER_INFRASTRUCTURES_LIMITED(0x10ED), + UNIVERSAL_ELECTRONICS_INC(0x10EE), + UNIVERSAL_ELECTRONICS_INC_2(0x10EF), + METRUM_TECHNOLOGIES_LLC(0x10F0), + CISCO(0x10F1), + UBISYS_TECHNOLOGIES_GMBH(0x10F2), + CONSERT(0x10F3), + CRESTRON_ELECTRONICS(0x10F4), + ENPHASE_ENERGY(0x10F5), + INVENSYS_CONTROLS(0x10F6), + MUELLER_SYSTEMS_LLC(0x10F7), + AAC_TECHNOLOGIES_HOLDING(0x10F8), + U_NEXT_CO(0x10F9), + STEELCASE_INC(0x10FA), + TELEMATICS_WIRELESS(0x10FB), + SAMIL_POWER_CO(0x10FC), + PACE_PLC(0x10FD), + OSBORNE_COINAGE_CO(0x10FE), + POWERWATCH(0x10FF), + CANDELED_GMBH(0x1100), + FLEXGRID_SRL(0x1101), + HUMAX(0x1102), + UNIVERSAL_DEVICES(0x1103), + ADVANCED_ENERGY(0x1104), + BEGA_GANTENBRINK_LEUCHTEN(0x1105), + BRUNEL_UNIVERSITY(0x1106), + PANASONIC_RD_CENTER_SINGAPORE(0x1107), + ESYSTEMS_RESEARCH(0x1108), + PANAMAX(0x1109), + SMARTTHINGS_INC(0x110A), + EM_LITE_LTD(0x110B), + OSRAM_SYLVANIA(0x110C), + SAVE_ENERGY_LTD(0x110D), + PLANET_INNOVATION_PRODUCTS_PTY_LTD(0x110E), + AMBIENT_DEVICES_INC(0x110F), + PROFALUX(0x1110), + BILLION_ELECTRIC_COMPANY(0x1111), + EMBERTEC_PTY_LTD(0x1112), + IT_WATCHDOGS(0x1113), + RELOC(0x1114), + INTEL_CORPORATION(0x1115), + TREND_ELECTRONICS_LIMITED(0x1116), + MOXA(0x1117), + QEES(0x1118), + SAYME_WIRELESS_SENSOR_NETWORKS(0x1119), + PENTAIR_AQUATIC_SYSTEMS(0x111A), + ORBIT_IRRIGATION(0x111B), + CALIFORNIA_EASTERN_LABORATORIES(0x111C), + IDT_TECHNOLOGY_LIMITED(0x111E), + PIXELA_CORPORATION(0x111F), + TIVO_INC(0x1120), + FIDURE_CORP(0x1121), + MARVELL_SEMICONDUCTOR_INC(0x1122), + WASION_GROUP_LIMITED(0x1123), + JASCO_PRODUCTS_COMPANY(0x1124), + SHENZHEN_KAIFA_TECHNOLOGY(0x1125), + NETCOMM_WIRELESS_LIMITED(0x1126), + DEFINE_INSTRUMENTS_LIMITED(0x1127), + IN_HOME_DISPLAYS_LTD(0x1128), + MIELE_AND_CIE_KG(0x1129), + TELEVES_SA(0x112A), + LABELEC(0x112B), + CHINA_ELECTRONICS_STANDARDIZATION_INSTITUTE(0x112C), + VECTORFORM_LLC(0x112D), + BUSCH_JAEGER_ELEKTRO(0x112E), + REDPINE_SIGNALS_INC(0x112F), + BRIDGES_ELECTRONIC_TECHNOLOGY_PTY_LTD(0x1130), + SERCOMM(0x1131), + WSH_GMBH_WIRSINDHELLER(0x1132), + BOSCH_SECURITY_SYSTEMS_INC(0x1133), + EZEX_CORPORATION(0x1134), + DRESDEN_ELEKTRONIK_INGENIEURTECHNIK_GMBH(0x1135), + MEAZON_SA(0x1136), + CROW_ELECTRONIC_ENGINEERING_LTD(0x1137), + HARVARD_ENGINEERING_PLC(0x1138), + ANDSON_BEIJING_TECHNOLOGY(0x1139), + ADHOCO_AG(0x113A), + WAXMAN_CONSUMER_PRODUCTS_GROUP_INC(0x113B), + OWON_TECHNOLOGY_INC(0x113C), + HITRON_TECHNOLOGIES_INC(0x113D), + SCEMTEC_HARD_UND_SOFTWARE(0x113E), + WEBEE_LLC(0x113F), + GRID2HOME_INC(0x1140), + TELINK_MICRO(0x1141), + JASMINE_SYSTEMS_INC(0x1142), + BIDGELY(0x1143), + LUTRON(0x1144), + IJENKO(0x1145), + STARFIELD_ELECTRONIC_LTD(0x1146), + TCP_INC(0x1147), + ROGERS_COMMUNICATIONS_PARTNERSHIP(0x1148), + CREE_INC(0x1149), + ROBERT_BOSCH_LLC(0x114A), + IBIS_NETWORKS_INC(0x114B), + QUIRKY_INC(0x114C), + EFERGY_TECHNOLOGIES_LIMITED(0x114D), + SMARTLABS_INC(0x114E), + EVERSPRING_INDUSTRY_CO_LTD(0x114F), + SWANN_COMMUNICATIONS_PTL_LTD(0x1150), + SONETER(0x1151), + SAMSUNG_SDS(0x1152), + UNIBAND_ELECTRONIC_CORPORATION(0x1153), + ACCTON_TECHNOLOGY_CORPORATION(0x1154), + BOSCH_THERMOTECHNIK_GMBH(0x1155), + WINCOR_NIXDORF_INC(0x1156), + OHSUNG_ELECTRONICS(0x1157), + ZEN_WITHIN_INC(0x1158), + TECH4HOME_LDA(0x1159), + NANOLEAF(0x115A), + KEEN_HOME_INC(0x115B), + POLY_CONTROL_APS(0x115C), + EASTFIELD_LIGHTING_CO_LTD_SHENZHEN(0x115D), + IP_DATATEL_INC(0x115E), + LUMI_UNITED_TECHOLOGY_LTD_SHENZHEN(0x115F), + SENGLED_CO_LTD(0x1160), + REMOTE_SOLUTION_CO_LTD(0x1161), + ABB_GENWAY_XIAMEN_ELECTRICAL_EQUIPMENT_CO(0x1162), + ZHEJIANG_REXENSE_TECH(0x1163), + FOREE_TECHNOLOGY(0x1164), + OPEN_ACCESS_TECHNOLOGY_INTL(0x1165), + INNR_LIGHTING_BV(0x1166), + TECHWORLD_INDUSTRIES(0x1167), + LEEDARSON_LIGHTING_CO_LTD(0x1168), + ARZEL_ZONING(0x1169), + HOLLEY_TECHNOLOGY(0x116A), + BELDON_TECHNOLOGIES(0x116B), + FLEXTRONICS(0x116C), + SHENZHEN_MEIAN(0x116D), + LOWES(0x116E), + SIGMA_CONNECTIVITY(0x116F), + WULIAN(0x1171), + PLUGWISE_BV(0x1172), + TITAN_PRODUCTS(0x1173), + ECOSPECTRAL(0x1174), + D_LINK(0x1175), + TECHNICOLOR_HOME_USA(0x1176), + OPPLE_LIGHTING(0x1177), + WISTRON_NEWEB_CORP(0x1178), + QMOTION_SHADES(0x1179), + INSTA_GMBH(0x117A), + SHANGHAI_VANCOUNT(0x117B), + IKEA_OF_SWEDEN(0x117C), + RT_RK(0x117D), + SHENZHEN_FEIBIT(0x117E), + EUCONTROLS(0x117F), + TELKONET(0x1180), + THERMAL_SOLUTION_RESOURCES(0x1181), + POMCUBE(0x1182), + EI_ELECTRONICS(0x1183), + OPTOGA(0x1184), + STELPRO(0x1185), + LYNXUS_TECHNOLOGIES_CORP(0x1186), + SEMICONDUCTOR_COMPONENTS(0x1187), + TP_LINK(0x1188), + LEDVANCE_GMBH(0x1189), + NORTEK(0x118A), + IREVO_ASSA_ABBLOY_KOREA(0x118B), + MIDEA(0x118C), + ZF_FRIEDRICHSHAFEN(0x118D), + CHECKIT(0x118E), + ACLARA(0x118F), + NOKIA(0x1190), + GOLDCARD_HIGH_TECH_CO(0x1191), + GEORGE_WILSON_INDUSTRIES_LTD(0x1192), + EASY_SAVER_CO_INC(0x1193), + ZTE_CORPORATION(0x1194), + ARRIS(0x1195), + RELIANCE_BIG_TV(0x1196), + INSIGHT_ENERGY_VENTURES_POWERLEY(0x1197), + THOMAS_RESEARCH_PRODUCTS(0x1198), + LI_SENG_TECHNOLOGY(0x1199), + SYSTEM_LEVEL_SOLUTIONS_INC(0x119A), + MATRIX_LABS(0x119B), + SINOPE_TECHNOLOGIES(0x119C), + JIUZHOU_GREEBLE(0x119D), + GUANGZHOU_LANVEE_TECH_CO_LTD(0x119E), + VENSTAR(0x119F), + SLV(0x1200), + HALO_SMART_LABS(0x1201), + SCOUT_SECURITY_INC(0x1202), + ALIBABA_CHINA_INC(0x1203), + RESOLUTION_PRODUCTS_INC(0x1204), + SMARTLOK_INC(0x1205), + LUX_PRODUCTS_CORP(0x1206), + VIMAR_SPA(0x1207), + UNIVERSAL_LIGHTING_TECHNOLOGIES(0x1208), + ROBERT_BOSCH_GMBH(0x1209), + ACCENTURE(0x120A), + HEIMAN_TECHNOLOGY_CO(0x120B), + SHENZHEN_HOMA_TECHNOLOGY_CO(0x120C), + VISION_ELECTRONICS_TECHNOLOGY(0x120D), + LENOVO(0x120E), + PRESCIENSE_RD(0x120F), + SHENZHEN_SEASTAR_INTELLIGENCE_CO(0x1210), + SENSATIVE_AB(0x1211), + SOLAREDGE(0x1212), + ZIPATO(0x1213), + CHINA_FIRE_SECURITY_SENSING_MANUFACTURING(0x1214), + QUBY_BV(0x1215), + HANGZHOU_ROOMBANKER_TECHNOLOGY_CO(0x1216), + AMAZON_LAB126(0x1217), + PAULMANN_LICHT_GMBH(0x1218), + SHENZHEN_ORVIBO_ELECTRONICS_CO_LTD(0x1219), + TCI_TELECOMMUNICATIONS(0x121A), + MUELLER_LICHT_INTERNATIONAL_INC(0x121B), + AURORA_LIMITED(0x121C), + SMARTDCC(0x121D), + SHANGHAI_UMEINFO_CO_LTD(0x121E), + CARBONTRACK(0x121F), + SOMFY(0x1220), + VIESSMANN_ELEKTRONIK_GMBH(0x1221), + HILDEBRAND_TECHNOLOGY_LTD(0x1222), + ONKYO_TECHNOLOGY_CORPORATION(0x1223), + SHENZHEN_SUNRICHER_TECHNOLOGY_LTD(0x1224), + XIU_XIU_TECHNOLOGY_CO_LTD(0x1225), + ZUMTOBEL_GROUP(0x1226), + SHENZHEN_KAADAS_INTELLIGENT_TECHNOLOGY_CO_LTD(0x1227), + SHANGHAI_XIAOYAN_TECHNOLOGY_CO_LTD(0x1228), + CYPRESS_SEMICONDUCTOR(0x1229), + XAL_GMBH(0x122A), + INERGY_SYSTEMS_LLC(0x122B), + ALFRED_KARCHER_GMBH_CO_KG(0x122C), + ADUROLIGHT_MANUFACTURING(0x122D), + GROUPE_MULLER(0x122E), + V_MARK_ENTERPRISES_INC(0x122F), + LEAD_ENERGY_AG(0x1230), + ULTIMATE_IOT_HENAN_TECHNOLOGY_LTD(0x1231), + AXXESS_INDUSTRIES_INC(0x1232), + THIRD_REALITY_INC(0x1233), + DSR_CORPORATION(0x1234), + GUANGZHOU_VENSI_INTELLIGENT_TECHNOLOGY(0x1235), + SCHLAGE_LOCK_ALLEGION(0x1236), + NET2GRID(0x1237), + AIRAM_ELECTRIC_OY_AB(0x1238), + IMMAX_WPB_CZ(0x1239), + ZIV_AUTOMATION(0x123A), + HANGZHOU_IMAGICTECHNOLOGY(0x123B), + XIAMEN_LEELEN_TECHNOLOGY(0x123C), + OVERKIZ_SAS(0x123D), + FLONIDAN_A_S(0x123E), + HDL_AUTOMATION(0x123F), + ARDOMUS_NETWORKS_CORPORATION(0x1240), + SAMJIN_CO_LTD(0x1241), + FIREANGEL_SAFETY_TECHNOLOGY(0x1242), + INDRA_SISTEMAS_SA(0x1243), + SHENZHEN_JBT_SMART_LIGHTING(0x1244), + GE_LIGHTING_CURRENT(0x1245), + DANFOSS_A_S(0x1246), + NIVISS_PHP_SP_Z_O_O_SP_K(0x1247), + SHENZHEN_FENGLIYUAN_ENERGY_CONSERVATING_TECHNOLOGY(0x1248), + NEXELEC(0x1249), + SICHUAN_BEHOME_PROMINENT_TECHNOLOGY(0x124A), + FUJIAN_STAR_NET_COMMUNICATION(0x124B), + TOSHIBA_VISUAL_SOLUTIONS_CORPORATION(0x124C), + LATCHABLE_INC(0x124D), + L_S_DEUTSCHLAND_GMBH(0x124E), + GLEDOPTO_CO_LTD(0x124F), + THE_HOME_DEPOT(0x1250), + NEONLITE_DISTRIBUTION_LIMITED(0x1251), + ARLO_TECHNOLOGIES_INC(0x1252), + XINGLUO_TECHNOLOGY_CO_LTD(0x1253), + SIMON_ELECTRIC_CHINA_CO_LTD(0x1254), + HANGZHOU_GREATSTAR_INDUSTRIAL_CO_LTD(0x1255), + SEQUENTRIC_ENERGY_SYSTEMS_LLC(0x1256), + SOLUM_CO_LTD(0x1257), + EAGLERISE_ELECTRIC_ELECTRONIC_CHINA_CO_LTD(0x1258), + FANTEM_TECHNOLOGIES_SHENZHEN_CO_LTD(0x1259), + YUNDING_NETWORK_TECHNOLOGY_BEIJING_CO_LTD(0x125A), + ATLANTIC_GROUP(0x125B), + XIAMEN_INTRETECH_INC(0x125C), + TUYA_GLOBAL_INC(0x125D), + DNAKE_XIAMEN_INTELLIGENT_TECHNOLOGY(0x125E), + NIKO_NV(0x125F), + EMPORIA_ENERGY(0x1260), + SIKOM_AS(0x1261), + AXIS_LABS_INC(0x1262), + CURRENT_PRODUCTS_CORPORATION(0x1263), + METERSIT_SRL(0x1264), + HORNBACH_BAUMARKT_AG(0x1265), + DICEWORLD_S_R_L_A_SOCIO_UNICO(0x1266), + ARC_TECHNOLOGY_CO_LTD(0x1267), + HANGZHOU_KONKE_INFORMATION_TECHNOLOGY(0x1268), + SALTO_SYSTEMS_SL(0x1269), + SHENZHEN_SHYUGJ_TECHNOLOGY(0x126A), + BRAYDEN_AUTOMATION_CORPORATION(0x126B), + ENVIRONEXUS_PTY_LTD(0x126C), + ELTRA_NV_SA(0x126D), + XIAOMI_COMMUNICATIONS_CO_LTD(0x126E), + SHANGHAI_SHUNCOM_ELECTRONIC_TECHNOLOGY(0x126F), + VOLTALIS_SA(0x1270), + FEELUX_CO_LTD(0x1271), + SMARTPLUS_INC(0x1272), + HALEMEIER_GMBH(0x1273), + TRUST_INTERNATIONAL_BV(0x1274), + DUKE_ENERGY_BUSINESS_SERVICES_LLC(0x1275), + CALIX_INC(0x1276), + ADEO(0x1277), + CONNECTED_RESPONSE_LIMITED(0x1278), + STROYENERGOKOM_LTD(0x1279), + LUMITECH_LIGHTING_SOLUTION_GMBH(0x127A), + VERDANT_ENVIRONMENTAL_TECHNOLOGIES(0x127B), + ALFRED_INTERNATIONAL_INC(0x127C), + ANSI_LED_LIGHTING_CO_LTD(0x127D), + MINDTREE_LIMITED(0x127E), + NORDIC_SEMICONDUCTOR_ASA(0x127F), + SITERWELL_ELECTRONICS_CO_LIMITED(0x1280), + BRILONER_LEUCHTEN_GMBH(0x1281), + SHENZHEN_SEI_TECHNOLOGY_CO_LTD(0x1282), + COPPER_LABS_INC(0x1283), + DELTA_DORE(0x1284), + HAGER_GROUP(0x1285), + SHENZHEN_COOLKIT_TECHNOLOGY_CO_LTD(0x1286), + HANGZHOU_SKY_LIGHTING_CO_LTD(0x1287), + E_ON_SE(0x1288), + LIDL_STIFTUNG_CO_KG(0x1289), + SICHUAN_CHANGHONG_NETWORK_TECHNOLOGIES(0x128A), + NODON(0x128B), + JIANGXI_INNOTECH_TECHNOLOGY_CO_LTD(0x128C), + MERCATOR_PTY_LTD(0x128D), + BEIJING_RUYING_TECH_LIMITED(0x128E), + EGLO_LEUCHTEN_GMBH(0x128F), + PIETRO_FIORENTINI_SPA(0x1290), + ZEHNDER_GROUP_VAUX_ANDIGNY(0x1291), + BRK_BRANDS_INC(0x1292), + ASKEY_COMPUTER_CORP(0x1293), + PASSIVEBOLT_INC(0x1294), + AVM_AUDIOVISUELLES_MARKETING_UND_COMPUTERSYSTEME_BERLIN(0x1295), + NINGBO_SUNTECH_LIGHTING_TECHNOLOGY_CO_LTD(0x1296), + SOCIETE_EN_COMMANDITE_STELLO(0x1297), + VIVINT_SMART_HOME(0x1298), + NAMRON_AS(0x1299), + RADEMACHER_GERATE_ELEKTRONIK_GMBH(0x129A), + OMO_SYSTEMS_LTD(0x129B), + SIGLIS_AG(0x129C), + IMHOTEP_CREATION(0x129D), + ICASA(0x129E), + LEVEL_HOME_INC(0x129F), + TIS_CONTROL_LIMITED(0x1300), + RADISYS_INDIA_PVT_LTD(0x1301), + VEEA_INC(0x1302), + FELL_TECHNOLOGY_AS(0x1303), + SOWILO_DESIGN_SERVICES_LTD(0x1304), + LEXI_DEVICES_INC(0x1305), + LIFI_LABS_INC_DBA_LIFX(0x1306), + GRUNDFOS_HOLDING_AS(0x1307), + SOURCING_AND_CREATION(0x1308), + KRAKEN_TECHNOLOGIES_LTD(0x1309), + EVE_SYSTEMS(0x130A), + LITE_ON_TECHNOLOGY_CORPORATION(0x130B), + FOCALCREST_LIMITED(0x130C), + BOUFFALO_LAB_NANJING_CO_LTD(0x130D), + WYZE_LABS_INC(0x130E), + Z_WAVE_EUROPE_GMBH(0x130F), + AEOTEC_LIMITED(0x1310), + NGSTB_COMPANY_LIMITED(0x1311), + QINGDAO_YEELINK_INFORMATION_TECHNOLOGY_CO_LTD(0x1312), + E_SMART_HOME_AUTOMATION_SYSTEMS_LIMITED(0x1313), + FIBAR_GROUP_SA(0x1314), + PROLITECH_GMBH(0x1315), + PANKORE_INTEGRATED_CIRCUIT_TECHNOLOGY_CO_LTD(0x1316), + LOGITECH(0x1317), + PIARO_INC(0x1318), + MITSUBISHI_ELECTRIC_US_INC(0x1319), + RESIDEO_TECHNOLOGIES_INC(0x131A), + ESPRESSIF_SYSTEMS_SHANGHAI_CO_LTD(0x131B), + HELLA_SONNEN_UND_WETTERSCHUTZTECHNIK_GMBH(0x131C), + GEBERIT_INTERNATIONAL_AG(0x131D), + CAME_SPA(0x131E), + GUANGZHOU_ELITE_EDUCATION_AND_TECHNOLOGY_CO_LTD(0x131F), + PHYPLUS_MICROELECTRONICS_LIMITED(0x1320), + SHENZHEN_SONOFF_TECHNOLOGIES_CO_LTD(0x1321), + SAFE4_SECURITY_GROUP(0x1322), + SHANGHAI_MXCHIP_INFORMATION_TECHNOLOGY_CO_LTD(0x1323), + HDC_I_CONTROLS(0x1324), + ZUMA_ARRAY_LIMITED(0x1325), + DECELECT(0x1326), + MILL_INTERNATIONAL_AS(0x1327), + HOMEWIZARD_BV(0x1328), + SHENZHEN_TOPBAND_CO(0x1329), + PRESSAC_COMMUNICATIONS_LTD(0x132A), + ORIGIN_WIRELESS_INC(0x132B), + CONNECTE_AS(0x132C), + YOKIS(0x132D), + XIAMEN_YANKON_ENERGETIC_LIGHTING_CO(0x132E), + YANDEX_LLC(0x132F), + CRITICAL_SOFTWARE_SA(0x1330), + NORTEK_CONTROL(0x1331), + BRIGHTAI(0x1332), + BECKER_ANTRIEBE_GMBH(0x1333), + SHENZHEN_TCL_NEW_TECHNOLOGY_COMPANY_LIMITED(0x1334), + DEXATEK_TECHNOLOGY_LTD(0x1335), + ELELABS_INTERNATIONAL_LIMITED(0x1336), + DATEK_WIRELESS_AS(0x1337), + ALDES(0x1338), + SAVANT_COMPANY(0x1339), + ARISTON_THERMO_GROUP(0x133A), + WAREMA_RENKHOFF_SE(0x133B), + VTECH_HOLDINGS_LIMITED(0x133C), + FUTUREHOME_AS(0x133D), + COGNITIVE_SYSTEMS_CORP(0x133E), + ASR_MICROELECTRONICS_SHENZHEN_CO(0x133F), + AIRIOS(0x1340), + GUANGDONG_OPPO_MOBILE_TELECOMMUNICATIONS_CORP(0x1341), + BEKEN_CORPORATION(0x1342), + CORSAIR(0x1343), + ELTAKO_GMBH(0x1344), + CHENGDU_MEROSS_TECHNOLOGY_CO(0x1345), + RAFAEL_MICROELECTRONICS_INC(0x1346), + AUG_WINKHUAS_GMBH_AND_CO_KG(0x1347), + QINGDAO_HAIER_TECHNOLOGY_CO(0x1348), + APPLE_INC(0x1349), + ROLLEASE_ACME(0x134A), + NABU_CASA_INC(0x134B), + SIMON_HOLDING(0x134C), + KD_NAVIEN(0x134D), + TADO_GMBH(0x134E), + MEDIOLA_CONNECTED_LIVING_AG(0x134F), + POLYNHOME(0x1350), + HOORII_TECHNOLOGY_CO(0x1351), + KIMIN_ELECTRONICS_CO(0x1353), + ZYAX_AB(0x1354), + BARACODA_SA(0x1355), + LENNOX_INTERNATIONAL_INC(0x1356), + TELEDACTICS_INCORPORATED(0x1357), + TOP_VICTORY_INVESTMENTS_LIMITED(0x1358), + GOQUAL_INC(0x1359), + SIEGENIA_AUBI_KG(0x135A), + VIRTUAL_CONNECTED_CONTROLLING_SYSTEM_SINGAPORE_PTE_LTD(0x135B), + GIGASET_COMMUNICATIONS_GMBH(0x135C), + NUKI_HOME_SOLUTIONS_GMBH(0x135D), + DEVICEBOOK_INC(0x135E), + CONSUMER_2_INC_RENTLY(0x135F), + EDISON_LABS_INC_ORRO(0x1360), + INOVELLI(0x1361), + DEVERITEC_GMBH(0x1362), + CHARTER_COMMUNICATIONS(0x1363), + MONOLITHIC_POWER_SYSTEMS_INC(0x1364), + NINGBO_DOOYA_MECHANIC_AND_ELECTRONIC_TECHNOLOGY_CO(0x1365), + SHENZHEN_SDMC_TECHNOLOGY_CO(0x1366), + HP_INC(0x1367), + MUI_LAB_INC(0x1368), + BHTRONICS_SRL(0x1369), + AKUVOX_XIAMEN_NETWORKS_CO(0x136A), + GEWISS_SPA(0x1994), + CLIMAX_TECHNOLOGY_CO(0x2794), + GOOGLE_LLC(0x6006), + CONNECTIVITY_STANDARDS_ALLIANCE_1(0xC5A0), + CONNECTIVITY_STANDARDS_ALLIANCE_2(0xC5A1), + CONNECTIVITY_STANDARDS_ALLIANCE_3(0xC5A2), + CONNECTIVITY_STANDARDS_ALLIANCE_4(0xC5A3), + CONNECTIVITY_STANDARDS_ALLIANCE_5(0xC5A4), + CONNECTIVITY_STANDARDS_ALLIANCE_6(0xC5A5), + CONNECTIVITY_STANDARDS_ALLIANCE_7(0xC5A6), + CONNECTIVITY_STANDARDS_ALLIANCE_8(0xC5A7), + CONNECTIVITY_STANDARDS_ALLIANCE_9(0xC5A8), + CONNECTIVITY_STANDARDS_ALLIANCE_10(0xC5A9), + CONNECTIVITY_STANDARDS_ALLIANCE_11(0xC5AA), + CONNECTIVITY_STANDARDS_ALLIANCE_12(0xC5AB), + CONNECTIVITY_STANDARDS_ALLIANCE_13(0xC5AC), + CONNECTIVITY_STANDARDS_ALLIANCE_14(0xC5AD), + CONNECTIVITY_STANDARDS_ALLIANCE_15(0xC5AE), + CONNECTIVITY_STANDARDS_ALLIANCE_16(0xC5AF), + TESTVENDOR1(0xFFF1), + TESTVENDOR2(0xFFF2), + TESTVENDOR3(0xFFF3), + TESTVENDOR4(0xFFF4), +} + From f9eb6ce8ce78ffcaf955f652bfd61f4e6daa9909 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 15 Jun 2023 17:48:26 -0400 Subject: [PATCH 21/31] Fix prettier-yaml restyler error. (#27277) See https://github.com/restyled-io/restyler/issues/208#issuecomment-1593198441 item 3: we are pinning a specific version of the prettier image, which means we have to use a command syntax that works with that version. --- .restyled.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.restyled.yaml b/.restyled.yaml index 75613cbb95619e..a57f9ce75a838a 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -190,6 +190,9 @@ restylers: - name: prettier-yaml image: restyled/restyler-prettier:v1.19.1-2 enabled: true + command: + - prettier + - "--write" include: - "**/*.yml" - "**/*.yaml" From 720996eed99505b0c2d47caea367955f9a546858 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Thu, 15 Jun 2023 16:24:20 -0700 Subject: [PATCH 22/31] suppress the error from unknown event (#27278) --- src/controller/java/AndroidCallbacks.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index a84bd92f65fdea..e236aef95fc41a 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -367,7 +367,10 @@ void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLV jobject value = DecodeEventValue(aEventHeader.mPath, readerForJavaObject, &err); // If we don't know this event, just skip it. - VerifyOrReturn(err != CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB); + if (err == CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB) + { + err = CHIP_NO_ERROR; + } VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(nullptr, eventPathObj, err)); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe(), ReportError(nullptr, eventPathObj, CHIP_JNI_ERROR_EXCEPTION_THROWN)); From 83f7a2fe136e0b746db09f1d19e36c693a634b66 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 15 Jun 2023 22:26:52 -0400 Subject: [PATCH 23/31] Expose the Basic Information VID/PID as part of attestation results. (#27282) * Expose the Basic Information VID/PID as part of attestation results. This lets consumers see what actual VID/PID was checked against the certification declaration during attestation. While the VID is available from the certification declaration (assuming attestation passed), without this change there is no way to recover the PID short of reading the Basic Information cluster and hoping that it's not malicious and returns the same value as the one that was previously validated against the certification declaration. Removes declaration for an un-implemented constructor of AttestationDeviceInfo. * Address review comments. --- .../DeviceAttestationVerifier.cpp | 4 +++- .../DeviceAttestationVerifier.h | 7 ++++++- .../CHIP/MTRDeviceAttestationDelegate.h | 18 ++++++++++++++++-- .../CHIP/MTRDeviceAttestationDelegate.mm | 4 ++++ .../CHIP/MTRDeviceAttestationDelegateBridge.mm | 4 +++- .../MTRDeviceAttestationDelegate_Internal.h | 4 +++- .../Framework/CHIPTests/MTRPairingTests.m | 5 +++++ 7 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp b/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp index ccaaa0eed88553..cc5d9d3030de80 100644 --- a/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp +++ b/src/credentials/attestation_verifier/DeviceAttestationVerifier.cpp @@ -124,7 +124,9 @@ static inline Platform::ScopedMemoryBufferWithSize CopyByteSpanHelper(c } DeviceAttestationVerifier::AttestationDeviceInfo::AttestationDeviceInfo(const AttestationInfo & attestationInfo) : - mPaiDerBuffer(CopyByteSpanHelper(attestationInfo.paiDerBuffer)), mDacDerBuffer(CopyByteSpanHelper(attestationInfo.dacDerBuffer)) + mPaiDerBuffer(CopyByteSpanHelper(attestationInfo.paiDerBuffer)), + mDacDerBuffer(CopyByteSpanHelper(attestationInfo.dacDerBuffer)), mBasicInformationVendorId(attestationInfo.vendorId), + mBasicInformationProductId(attestationInfo.productId) { ByteSpan certificationDeclarationSpan; ByteSpan attestationNonceSpan; diff --git a/src/credentials/attestation_verifier/DeviceAttestationVerifier.h b/src/credentials/attestation_verifier/DeviceAttestationVerifier.h index b79dd392aeb3bc..0f32a91b206cdd 100644 --- a/src/credentials/attestation_verifier/DeviceAttestationVerifier.h +++ b/src/credentials/attestation_verifier/DeviceAttestationVerifier.h @@ -295,7 +295,6 @@ class DeviceAttestationVerifier { public: AttestationDeviceInfo(const AttestationInfo & attestationInfo); - AttestationDeviceInfo(const ByteSpan & attestationElementsBuffer, const ByteSpan paiDerBuffer, const ByteSpan dacDerBuffer); ~AttestationDeviceInfo() = default; @@ -318,10 +317,16 @@ class DeviceAttestationVerifier } } + uint16_t BasicInformationVendorId() const { return mBasicInformationVendorId; } + + uint16_t BasicInformationProductId() const { return mBasicInformationProductId; } + private: Platform::ScopedMemoryBufferWithSize mPaiDerBuffer; Platform::ScopedMemoryBufferWithSize mDacDerBuffer; Platform::ScopedMemoryBufferWithSize mCdBuffer; + uint16_t mBasicInformationVendorId; + uint16_t mBasicInformationProductId; }; typedef void (*OnAttestationInformationVerification)(void * context, const AttestationInfo & info, diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h index a76f0c20145a17..889ba88096e69e 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.h @@ -28,15 +28,29 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)new NS_UNAVAILABLE; /** - * The vendor ID for the device from the Device Attestation Certificate. May be nil only if attestation was unsucessful. + * The vendor ID from the Device Attestation Certificate. May be nil only if attestation was unsuccessful. */ @property (nonatomic, readonly, nullable) NSNumber * vendorID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** - * The product ID for the device from the Device Attestation Certificate. May be nil only if attestation was unsucessful. + * The product ID from the Device Attestation Certificate. May be nil only if attestation was unsuccessful. */ @property (nonatomic, readonly, nullable) NSNumber * productID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * The vendor ID value from the device's Basic Information cluster that was used + * for device attestation. If attestation succeeds, this must match the vendor + * ID from the certification declaration. + */ +@property (nonatomic, readonly) NSNumber * basicInformationVendorID MTR_NEWLY_AVAILABLE; + +/** + * The product ID value from the device's Basic Information cluster that was + * used for device attestation. If attestation succeeds, this must match one of + * the product IDs from the certification declaration. + */ +@property (nonatomic, readonly) NSNumber * basicInformationProductID MTR_NEWLY_AVAILABLE; + @property (nonatomic, readonly) MTRCertificateDERBytes dacCertificate; @property (nonatomic, readonly) MTRCertificateDERBytes dacPAICertificate; @property (nonatomic, readonly, nullable) NSData * certificateDeclaration; diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm index a31292f7f75102..273f03ef31f623 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate.mm @@ -28,11 +28,15 @@ @implementation MTRDeviceAttestationDeviceInfo - (instancetype)initWithDACCertificate:(MTRCertificateDERBytes)dacCertificate dacPAICertificate:(MTRCertificateDERBytes)dacPAICertificate certificateDeclaration:(NSData *)certificateDeclaration + basicInformationVendorID:(NSNumber *)basicInformationVendorID + basicInformationProductID:(NSNumber *)basicInformationProductID { if (self = [super init]) { _dacCertificate = [dacCertificate copy]; _dacPAICertificate = [dacPAICertificate copy]; _certificateDeclaration = [certificateDeclaration copy]; + _basicInformationVendorID = [basicInformationVendorID copy]; + _basicInformationProductID = [basicInformationProductID copy]; struct AttestationCertVidPid dacVidPid; if (ExtractVIDPIDFromX509Cert(AsByteSpan(_dacCertificate), dacVidPid) == CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm index 65528045710008..b9179185f959f1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegateBridge.mm @@ -43,7 +43,9 @@ MTRDeviceAttestationDeviceInfo * deviceInfo = [[MTRDeviceAttestationDeviceInfo alloc] initWithDACCertificate:dacData dacPAICertificate:paiData - certificateDeclaration:cdData]; + certificateDeclaration:cdData + basicInformationVendorID:@(info.BasicInformationVendorId()) + basicInformationProductID:@(info.BasicInformationProductId())]; NSError * error = (attestationResult == chip::Credentials::AttestationVerificationResult::kSuccess) ? nil : [MTRError errorForCHIPErrorCode:CHIP_ERROR_INTEGRITY_CHECK_FAILED]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h index 9b978a903be76c..a19db3f6e6c591 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceAttestationDelegate_Internal.h @@ -23,7 +23,9 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithDACCertificate:(MTRCertificateDERBytes)dacCertificate dacPAICertificate:(MTRCertificateDERBytes)dacPAICertificate - certificateDeclaration:(NSData *)certificateDeclaration; + certificateDeclaration:(NSData *)certificateDeclaration + basicInformationVendorID:(NSNumber *)basicInformationVendorID + basicInformationProductID:(NSNumber *)basicInformationProductID; @end diff --git a/src/darwin/Framework/CHIPTests/MTRPairingTests.m b/src/darwin/Framework/CHIPTests/MTRPairingTests.m index b9d012776a0d2a..5043744286486a 100644 --- a/src/darwin/Framework/CHIPTests/MTRPairingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPairingTests.m @@ -64,6 +64,11 @@ - (void)deviceAttestationCompletedForController:(MTRDeviceController *)controlle error:(NSError * _Nullable)error { [self.expectation fulfill]; + // Hard-coded to what our example server app uses for now. + // TODO: Build an example that uses the "origin" bits that allow a DAC and + // CD to have different vendor IDs, and verify things here. + XCTAssertEqualObjects(attestationDeviceInfo.basicInformationVendorID, @(0xFFF1)); + XCTAssertEqualObjects(attestationDeviceInfo.basicInformationProductID, @(0x8001)); [controller continueCommissioningDevice:opaqueDeviceHandle ignoreAttestationFailure:NO error:nil]; } From 9354db4ce61d12c83d8de69529addb439607a86e Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Fri, 16 Jun 2023 14:08:10 +0100 Subject: [PATCH 24/31] Adding Test Scripts for Concentration Measurement Clusters (#27215) * Added carbon monoxide measurement test yaml * Added additional concentration measurement test scripts * Updating conc meas clusters in all clusters to support all PICS * Restyled by whitespace * Restyled by prettier-yaml * Fixed formatting on comments * Adding ci pics * Restyled by prettier-yaml * Updates to darwin TestCommandBridge to not always assume the constraint is an integer c/o bzbarsky-apple * Fixed error in TC_CMO_CONC_1_1 with extra && * Adding excludes tests for when the PICS are not switched on and regen tests * Fixed embarrassing typo in hasMasksSet * Restyled by whitespace * Restyled by prettier-yaml * Remove dot in the cluster name for the python chip yaml runner --------- Co-authored-by: Restyled.io --- .../all-clusters-app.matter | 84 +- .../all-clusters-common/all-clusters-app.zap | 152 +- .../commands/tests/TestCommandBridge.h | 20 +- src/app/tests/suites/certification/PICS.yaml | 1056 ++ .../certification/Test_TC_CDOCONC_1_1.yaml | 326 + .../certification/Test_TC_CDOCONC_2_1.yaml | 132 + .../certification/Test_TC_CMOCONC_1_1.yaml | 326 + .../certification/Test_TC_CMOCONC_2_1.yaml | 132 + .../certification/Test_TC_FLDCONC_1_1.yaml | 326 + .../certification/Test_TC_FLDCONC_2_1.yaml | 132 + .../certification/Test_TC_NDOCONC_1_1.yaml | 326 + .../certification/Test_TC_NDOCONC_2_1.yaml | 132 + .../certification/Test_TC_OZCONC_1_1.yaml | 323 + .../certification/Test_TC_OZCONC_2_1.yaml | 132 + .../certification/Test_TC_PMHCONC_1_1.yaml | 326 + .../certification/Test_TC_PMHCONC_2_1.yaml | 132 + .../certification/Test_TC_PMICONC_1_1.yaml | 326 + .../certification/Test_TC_PMICONC_2_1.yaml | 132 + .../certification/Test_TC_PMKCONC_1_1.yaml | 326 + .../certification/Test_TC_PMKCONC_2_1.yaml | 132 + .../certification/Test_TC_RNCONC_1_1.yaml | 323 + .../certification/Test_TC_RNCONC_2_1.yaml | 132 + .../certification/Test_TC_TVOCCONC_1_1.yaml | 326 + .../certification/Test_TC_TVOCCONC_2_1.yaml | 132 + .../tests/suites/certification/ci-pics-values | 287 + src/app/tests/suites/ciTests.json | 23 + src/controller/python/chip/yaml/runner.py | 2 +- .../chip-tool/zap-generated/test/Commands.h | 7569 ++++++++ .../zap-generated/test/Commands.h | 15125 ++++++++++++++++ 29 files changed, 28803 insertions(+), 89 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml 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 02d9c1ddec2298..1fd288a34aabd8 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 @@ -4366,9 +4366,14 @@ server cluster NitrogenDioxideConcentrationMeasurement = 1043 { readonly attribute nullable single measuredValue = 0; readonly attribute nullable single minMeasuredValue = 1; readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; readonly attribute single uncertainty = 7; readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4413,6 +4418,15 @@ server cluster OzoneConcentrationMeasurement = 1045 { kAverageMeasurement = 0x20; } + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; @@ -4514,6 +4528,16 @@ server cluster FormaldehydeConcentrationMeasurement = 1067 { kAverageMeasurement = 0x20; } + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; + readonly attribute MeasurementMediumEnum measurementMedium = 9; readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -4679,6 +4703,7 @@ server cluster TotalVolatileOrganicCompoundsConcentrationMeasurement = 1070 { readonly attribute single uncertainty = 7; readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; + readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -4723,6 +4748,15 @@ server cluster RadonConcentrationMeasurement = 1071 { kAverageMeasurement = 0x20; } + readonly attribute nullable single measuredValue = 0; + readonly attribute nullable single minMeasuredValue = 1; + readonly attribute nullable single maxMeasuredValue = 2; + readonly attribute nullable single peakMeasuredValue = 3; + readonly attribute elapsed_s peakMeasuredValueWindow = 4; + readonly attribute nullable single averageMeasuredValue = 5; + readonly attribute elapsed_s averageMeasuredValueWindow = 6; + readonly attribute single uncertainty = 7; + readonly attribute MeasurementUnitEnum measurementUnit = 8; readonly attribute MeasurementMediumEnum measurementMedium = 9; readonly attribute LevelValueEnum levelValue = 10; readonly attribute command_id generatedCommandList[] = 65528; @@ -6617,25 +6651,39 @@ endpoint 1 { ram attribute measuredValue default = 3; ram attribute minMeasuredValue default = 1; ram attribute maxMeasuredValue default = 150; + ram attribute peakMeasuredValue default = 3; + ram attribute peakMeasuredValueWindow default = 120; + ram attribute averageMeasuredValue default = 3; + ram attribute averageMeasuredValueWindow default = 120; ram attribute uncertainty default = 1; ram attribute measurementUnit default = 1; ram attribute measurementMedium default = 0; + ram attribute levelValue default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 1; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } server cluster OzoneConcentrationMeasurement { + ram attribute measuredValue default = 10; + ram attribute minMeasuredValue default = 3; + ram attribute maxMeasuredValue default = 300; + ram attribute peakMeasuredValue default = 50; + ram attribute peakMeasuredValueWindow default = 3600; + ram attribute averageMeasuredValue default = 20; + ram attribute averageMeasuredValueWindow default = 3600; + ram attribute uncertainty default = 0; + ram attribute measurementUnit default = 0; ram attribute measurementMedium default = 0; ram attribute levelValue default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 14; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } @@ -6660,12 +6708,22 @@ endpoint 1 { } server cluster FormaldehydeConcentrationMeasurement { - ram attribute levelValue default = 3; + ram attribute measuredValue default = 10; + ram attribute minMeasuredValue default = 0; + ram attribute maxMeasuredValue default = 200; + ram attribute peakMeasuredValue default = 10; + ram attribute peakMeasuredValueWindow default = 7200; + ram attribute averageMeasuredValue default = 2; + ram attribute averageMeasuredValueWindow default = 7200; + ram attribute uncertainty default = 0; + ram attribute measurementUnit default = 3; + ram attribute measurementMedium default = 0; + ram attribute levelValue default = 2; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 2; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } @@ -6690,7 +6748,7 @@ endpoint 1 { } server cluster Pm10ConcentrationMeasurement { - ram attribute measuredValue; + ram attribute measuredValue default = 7; ram attribute minMeasuredValue default = 2; ram attribute maxMeasuredValue default = 400; ram attribute peakMeasuredValue default = 49; @@ -6720,22 +6778,32 @@ endpoint 1 { ram attribute uncertainty default = 1; ram attribute measurementUnit default = 1; ram attribute measurementMedium default = 0; + ram attribute levelValue default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 49; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } server cluster RadonConcentrationMeasurement { + ram attribute measuredValue default = 10; + ram attribute minMeasuredValue default = 5; + ram attribute maxMeasuredValue default = 100; + ram attribute peakMeasuredValue default = 36; + ram attribute peakMeasuredValueWindow default = 3600; + ram attribute averageMeasuredValue default = 20; + ram attribute averageMeasuredValueWindow default = 3600; + ram attribute uncertainty default = 0; + ram attribute measurementUnit default = 0; ram attribute measurementMedium default = 0; - ram attribute levelValue default = 4; + ram attribute levelValue default = 3; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 14; + ram attribute featureMap default = 63; ram attribute clusterRevision default = 1; } 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 e9d11230130810..bbdf3a2c461b57 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 @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data with some extensions" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -21988,11 +21988,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22004,11 +22004,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "120", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22020,11 +22020,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22036,11 +22036,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "120", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22100,11 +22100,11 @@ "mfgCode": null, "side": "server", "type": "LevelValueEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22184,7 +22184,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22264,11 +22264,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22280,11 +22280,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22296,11 +22296,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "300", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22312,11 +22312,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "50", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22328,11 +22328,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22344,11 +22344,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22360,11 +22360,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22376,7 +22376,7 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -22392,7 +22392,7 @@ "mfgCode": null, "side": "server", "type": "MeasurementUnitEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -22508,7 +22508,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "14", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22912,11 +22912,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22928,11 +22928,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22944,11 +22944,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "200", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22960,11 +22960,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22976,11 +22976,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "7200", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -22992,11 +22992,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23008,11 +23008,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "7200", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23024,7 +23024,7 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -23040,11 +23040,11 @@ "mfgCode": null, "side": "server", "type": "MeasurementUnitEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23056,7 +23056,7 @@ "mfgCode": null, "side": "server", "type": "MeasurementMediumEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -23076,7 +23076,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23156,7 +23156,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -23564,7 +23564,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24044,11 +24044,11 @@ "mfgCode": null, "side": "server", "type": "LevelValueEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24128,7 +24128,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "49", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24208,11 +24208,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "10", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24224,11 +24224,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "5", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24240,11 +24240,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "100", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24256,11 +24256,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "36", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24272,11 +24272,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24288,11 +24288,11 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24304,11 +24304,11 @@ "mfgCode": null, "side": "server", "type": "elapsed_s", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3600", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24320,7 +24320,7 @@ "mfgCode": null, "side": "server", "type": "single", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -24336,7 +24336,7 @@ "mfgCode": null, "side": "server", "type": "MeasurementUnitEnum", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -24372,7 +24372,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "4", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24452,7 +24452,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "14", + "defaultValue": "63", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h index b99c5976588b3b..445758958fd169 100644 --- a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h +++ b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h @@ -422,34 +422,46 @@ class TestCommandBridge : public CHIPCommandBridge, // Used when the minValue is a saved variable, since ConstraintsChecker does // not expect Core Foundation types. - template ::value, int> = 0> + template ::value && std::is_signed::value, int> = 0> bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected longLongValue]); } - template ::value, int> = 0> + template ::value && !std::is_signed::value, int> = 0> bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected unsignedLongLongValue]); } + template ::value, int> = 0> + bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) + { + return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected doubleValue]); + } + using ConstraintsChecker::CheckConstraintMaxValue; // Used when the maxValue is a saved variable, since ConstraintsChecker does // not expect Core Foundation types. - template ::value, int> = 0> + template ::value && std::is_signed::value, int> = 0> bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected longLongValue]); } - template ::value, int> = 0> + template ::value && !std::is_signed::value, int> = 0> bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) { return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected unsignedLongLongValue]); } + template ::value, int> = 0> + bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected) + { + return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected doubleValue]); + } + bool CheckConstraintHasValue(const char * _Nonnull itemName, id _Nullable current, bool shouldHaveValue) { if (shouldHaveValue && (current == nil)) { diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index c361661a9a17cb..67ce7560c7456c 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -8245,3 +8245,1059 @@ PICS: # - label: "Changes air quality significantly" id: AIRQUAL.M.AirQualityChange + + # Carbon Dioxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Carbon Dioxide Concentration + Measurement Cluster as a server?" + id: CDOCONC.S + + - label: + "Does the device implement the Carbon Dioxide Concentration + Measurement Cluster as a client?" + id: CDOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: CDOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: CDOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: CDOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: CDOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: CDOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: CDOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: CDOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: CDOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: CDOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: CDOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: CDOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: CDOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: CDOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: CDOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: CDOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: CDOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: CDOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: CDOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: CDOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: CDOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: CDOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: CDOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: CDOCONC.S.Afffd + + # Carbon Monoxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a server?" + id: CMOCONC.S + + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a client?" + id: CMOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: CMOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: CMOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: CMOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: CMOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: CMOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: CMOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: CMOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: CMOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: CMOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: CMOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: CMOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: CMOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: CMOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: CMOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: CMOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: CMOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: CMOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: CMOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: CMOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: CMOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: CMOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: CMOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: CMOCONC.S.Afffd + + # Carbon Monoxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a server?" + id: CMOCONC.S + + - label: + "Does the device implement the Carbon Monoxide Concentration + Measurement Cluster as a client?" + id: CMOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: CMOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: CMOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: CMOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: CMOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: CMOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: CMOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: CMOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: CMOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: CMOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: CMOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: CMOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: CMOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: CMOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: CMOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: CMOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: CMOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: CMOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: CMOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: CMOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: CMOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: CMOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: CMOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: CMOCONC.S.Afffd + + # Nitrogen Dioxide Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Nitrogen Dioxide Concentration + Measurement Cluster as a server?" + id: NDOCONC.S + + - label: + "Does the device implement the Nitrogen Dioxide Concentration + Measurement Cluster as a client?" + id: NDOCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: NDOCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: NDOCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: NDOCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: NDOCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: NDOCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: NDOCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: NDOCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: NDOCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: NDOCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: NDOCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: NDOCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: NDOCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: NDOCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: NDOCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: NDOCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: NDOCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: NDOCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: NDOCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: NDOCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: NDOCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: NDOCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: NDOCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: NDOCONC.S.Afffd + + # Ozone Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Ozone Concentration Measurement Cluster + as a server?" + id: OZCONC.S + + - label: + "Does the device implement the Ozone Concentration Measurement Cluster + as a client?" + id: OZCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: OZCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: OZCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: OZCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: OZCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: OZCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: OZCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: OZCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: OZCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: OZCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: OZCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: OZCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: OZCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: OZCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: OZCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: OZCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: OZCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: OZCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: OZCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: OZCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: OZCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: OZCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: OZCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: OZCONC.S.Afffd + + # PM2.5 Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the PM2.5 Concentration Measurement Cluster + as a server?" + id: PMICONC.S + + - label: + "Does the device implement the PM2.5 Concentration Measurement Cluster + as a client?" + id: PMICONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: PMICONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: PMICONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: PMICONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: PMICONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: PMICONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: PMICONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: PMICONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: PMICONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: PMICONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: PMICONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: PMICONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: PMICONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: PMICONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: PMICONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: PMICONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: PMICONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: PMICONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: PMICONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: PMICONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: PMICONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: PMICONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: PMICONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: PMICONC.S.Afffd + + # Formaldehyde Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Formaldehyde Concentration Measurement + Cluster as a server?" + id: FLDCONC.S + + - label: + "Does the device implement the Formaldehyde Concentration Measurement + Cluster as a client?" + id: FLDCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: FLDCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: FLDCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: FLDCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: FLDCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: FLDCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: FLDCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: FLDCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: FLDCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: FLDCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: FLDCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: FLDCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: FLDCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: FLDCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: FLDCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: FLDCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: FLDCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: FLDCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: FLDCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: FLDCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: FLDCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: FLDCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: FLDCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: FLDCONC.S.Afffd + + # PM1 Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the PM1 Concentration Measurement Cluster + as a server?" + id: PMHCONC.S + + - label: + "Does the device implement the PM1 Concentration Measurement Cluster + as a client?" + id: PMHCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: PMHCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: PMHCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: PMHCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: PMHCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: PMHCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: PMHCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: PMHCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: PMHCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: PMHCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: PMHCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: PMHCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: PMHCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: PMHCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: PMHCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: PMHCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: PMHCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: PMHCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: PMHCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: PMHCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: PMHCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: PMHCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: PMHCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: PMHCONC.S.Afffd + + # PM10 Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the PM10 Concentration Measurement Cluster + as a server?" + id: PMKCONC.S + + - label: + "Does the device implement the PM10 Concentration Measurement Cluster + as a client?" + id: PMKCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: PMKCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: PMKCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: PMKCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: PMKCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: PMKCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: PMKCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: PMKCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: PMKCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: PMKCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: PMKCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: PMKCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: PMKCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: PMKCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: PMKCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: PMKCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: PMKCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: PMKCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: PMKCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: PMKCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: PMKCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: PMKCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: PMKCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: PMKCONC.S.Afffd + + # Total Volatile Organic Compounds Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Total Volatile Organic Compounds + Concentration Measurement Cluster as a server?" + id: TVOCCONC.S + + - label: + "Does the device implement the Total Volatile Organic Compounds + Concentration Measurement Cluster as a client?" + id: TVOCCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: TVOCCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: TVOCCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: TVOCCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: TVOCCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: TVOCCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: TVOCCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: TVOCCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: TVOCCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: TVOCCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: TVOCCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: TVOCCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: TVOCCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: TVOCCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: TVOCCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: TVOCCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: TVOCCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: TVOCCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: TVOCCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: TVOCCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: TVOCCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: TVOCCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: TVOCCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: TVOCCONC.S.Afffd + + # Radon Concentration Measurement Cluster Test Plan + - label: + "Does the device implement the Radon Concentration Measurement Cluster + as a server?" + id: RNCONC.S + + - label: + "Does the device implement the Radon Concentration Measurement Cluster + as a client?" + id: RNCONC.C + + # + # server / features + # + + - label: "Does the DUT(server) support the Numeric Measurement feature?" + id: RNCONC.S.F00 + + - label: "Does the DUT(server) support the Level Indication feature?" + id: RNCONC.S.F01 + + - label: "Does the DUT(server) support the Medium Level feature?" + id: RNCONC.S.F02 + + - label: "Does the DUT(server) support the Critical Level feature?" + id: RNCONC.S.F03 + + - label: "Does the DUT(server) support the Peak Measurement feature?" + id: RNCONC.S.F04 + + - label: "Does the DUT(server) support the Average Measurement feature?" + id: RNCONC.S.F05 + + # + # server / attributes + # + + - label: "Does the DUT(server) implement the MeasuredValue attribute?" + id: RNCONC.S.A0000 + + - label: "Does the DUT(server) implement the MinMeasuredValue attribute?" + id: RNCONC.S.A0001 + + - label: "Does the DUT(server) implement the MaxMeasuredValue attribute?" + id: RNCONC.S.A0002 + + - label: "Does the DUT(server) implement the PeakMeasuredValue attribute?" + id: RNCONC.S.A0003 + + - label: + "Does the DUT(server) implement the PeakMeasuredValueWindow attribute?" + id: RNCONC.S.A0004 + + - label: + "Does the DUT(server) implement the AverageMeasuredValue attribute?" + id: RNCONC.S.A0005 + + - label: + "Does the DUT(server) implement the AverageMeasuredValueWindow + attribute?" + id: RNCONC.S.A0006 + + - label: "Does the DUT(server) implement the Uncertainty attribute?" + id: RNCONC.S.A0007 + + - label: "Does the DUT(server) implement the MeasurementUnit attribute?" + id: RNCONC.S.A0008 + + - label: "Does the DUT(server) implement the MeasurementMedium attribute?" + id: RNCONC.S.A0009 + + - label: "Does the DUT(server) implement the LevelValue attribute?" + id: RNCONC.S.A000a + + - label: + "Does the device implement the (0xFFF8) GeneratedCommandList + attribute?" + id: RNCONC.S.Afff8 + + - label: + "Does the device implement the (0xFFF9) AcceptedCommandList attribute?" + id: RNCONC.S.Afff9 + + - label: "Does the device implement the (0xFFFA) EventList attribute ?" + id: RNCONC.S.Afffa + + - label: "Does the device implement the (0xFFFB) AttributeList attribute ?" + id: RNCONC.S.Afffb + + - label: "Does the device implement the (0xFFFC) FeatureMap attribute ?" + id: RNCONC.S.Afffc + + - label: + "Does the device implement the (0xFFFD) ClusterRevision attribute ?" + id: RNCONC.S.Afffd diff --git a/src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml new file mode 100644 index 00000000000000..96322964ee381d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CDOCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-CDOCONC-1.1] Global Attributes with DUT as Server + +PICS: + - CDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: CDOCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && CDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CDOCONC.S.Afffc && !CDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.A0007 && CDOCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when CDOCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + CDOCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when CDOCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when CDOCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && CDOCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + CDOCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CDOCONC.S.Afffb && !CDOCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: CDOCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: CDOCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: CDOCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml new file mode 100644 index 00000000000000..8c4e2c94f0f206 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-CDOCONC-2.1] Attributes with server as DUT + +PICS: + - CDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: CDOCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: CDOCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: CDOCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: CDOCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: CDOCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: CDOCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: CDOCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: CDOCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: CDOCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: CDOCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml new file mode 100644 index 00000000000000..038e7fea3ae448 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CMOCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-CMOCONC-1.1] Global Attributes with DUT as Server + +PICS: + - CMOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Monoxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: CMOCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && CMOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: CMOCONC.S.Afffc && !CMOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.A0007 && CMOCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when CMOCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + CMOCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when CMOCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when CMOCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && CMOCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + CMOCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: CMOCONC.S.Afffb && !CMOCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: CMOCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: CMOCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: CMOCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml new file mode 100644 index 00000000000000..84c4410dbee398 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-CMOCONC-2.1] Attributes with server as DUT + +PICS: + - CMOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Carbon Monoxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: CMOCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: CMOCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: CMOCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: CMOCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: CMOCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: CMOCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: CMOCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: CMOCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: CMOCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: CMOCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml new file mode 100644 index 00000000000000..7edd006fcc2b14 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_FLDCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-FLDCONC-1.1] Global Attributes with DUT as Server + +PICS: + - FLDCONC.S + +config: + nodeId: 0x12344321 + cluster: "Formaldehyde Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: FLDCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && FLDCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: FLDCONC.S.Afffc && !FLDCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.A0007 && FLDCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when FLDCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + FLDCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when FLDCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when FLDCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && FLDCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + FLDCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: FLDCONC.S.Afffb && !FLDCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: FLDCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: FLDCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: FLDCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml new file mode 100644 index 00000000000000..88e113b1845488 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-FLDCONC-2.1] Attributes with server as DUT + +PICS: + - FLDCONC.S + +config: + nodeId: 0x12344321 + cluster: "Formaldehyde Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: FLDCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: FLDCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: FLDCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: FLDCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: FLDCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: FLDCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: FLDCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: FLDCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: FLDCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: FLDCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml new file mode 100644 index 00000000000000..141e04ca8ab9bf --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NDOCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-NDOCONC-1.1] Global Attributes with DUT as Server + +PICS: + - NDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Nitrogen Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: NDOCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && NDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: NDOCONC.S.Afffc && !NDOCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.A0007 && NDOCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when NDOCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + NDOCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when NDOCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when NDOCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && NDOCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + NDOCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: NDOCONC.S.Afffb && !NDOCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: NDOCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: NDOCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: NDOCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml new file mode 100644 index 00000000000000..2b4efbf5b459aa --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-NDOCONC-2.1] Attributes with server as DUT + +PICS: + - NDOCONC.S + +config: + nodeId: 0x12344321 + cluster: "Nitrogen Dioxide Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: NDOCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: NDOCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: NDOCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: NDOCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: NDOCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: NDOCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: NDOCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: NDOCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: NDOCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: NDOCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml new file mode 100644 index 00000000000000..48699e1875248c --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OZCONC_1_1.yaml @@ -0,0 +1,323 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-OZCONC-1.1] Global Attributes with DUT as Server + +PICS: + - OZCONC.S + +config: + nodeId: 0x12344321 + cluster: "Ozone Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: OZCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: "Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: "Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && OZCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: OZCONC.S.Afffc && !OZCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.A0007 && OZCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when OZCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + OZCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when OZCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when OZCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && OZCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + OZCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: OZCONC.S.Afffb && !OZCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: OZCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: OZCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: OZCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml new file mode 100644 index 00000000000000..a022b6a9475012 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-OZCONC-2.1] Attributes with server as DUT + +PICS: + - OZCONC.S + +config: + nodeId: 0x12344321 + cluster: "Ozone Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: OZCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: OZCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: OZCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: OZCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: OZCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: OZCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: OZCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: OZCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: OZCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: OZCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml new file mode 100644 index 00000000000000..866f5c2b6fd6ab --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMHCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-PMHCONC-1.1] Global Attributes with DUT as Server + +PICS: + - PMHCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM1 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: PMHCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && PMHCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMHCONC.S.Afffc && !PMHCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.A0007 && PMHCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when PMHCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + PMHCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when PMHCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when PMHCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && PMHCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + PMHCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMHCONC.S.Afffb && !PMHCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: PMHCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: PMHCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: PMHCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml new file mode 100644 index 00000000000000..5a86bf09654f7a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-PMHCONC-2.1] Attributes with server as DUT + +PICS: + - PMHCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM1 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: PMHCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: PMHCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: PMHCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: PMHCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: PMHCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: PMHCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: PMHCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: PMHCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: PMHCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: PMHCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml new file mode 100644 index 00000000000000..1d9e1c5168ea1e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMICONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-PMICONC-1.1] Global Attributes with DUT as Server + +PICS: + - PMICONC.S + +config: + nodeId: 0x12344321 + cluster: "PM2.5 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: PMICONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given PMICONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && PMICONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMICONC.S.Afffc && !PMICONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.A0007 && PMICONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when PMICONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + PMICONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when PMICONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when PMICONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && PMICONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + PMICONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMICONC.S.Afffb && !PMICONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: PMICONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: PMICONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: PMICONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml new file mode 100644 index 00000000000000..34e5856a092bc2 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-PMICONC-2.1] Attributes with server as DUT + +PICS: + - PMICONC.S + +config: + nodeId: 0x12344321 + cluster: "PM2.5 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: PMICONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: PMICONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: PMICONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: PMICONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: PMICONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: PMICONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: PMICONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: PMICONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: PMICONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: PMICONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml new file mode 100644 index 00000000000000..b0443d6aa1f38b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMKCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-PMKCONC-1.1] Global Attributes with DUT as Server + +PICS: + - PMKCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM10 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: PMKCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && PMKCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: PMKCONC.S.Afffc && !PMKCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.A0007 && PMKCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when PMKCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + PMKCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when PMKCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when PMKCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && PMKCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + PMKCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: PMKCONC.S.Afffb && !PMKCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: PMKCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: PMKCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: PMKCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml new file mode 100644 index 00000000000000..306df0864ddcfa --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-PMKCONC-2.1] Attributes with server as DUT + +PICS: + - PMKCONC.S + +config: + nodeId: 0x12344321 + cluster: "PM10 Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: PMKCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: PMKCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: PMKCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: PMKCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: PMKCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: PMKCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: PMKCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: PMKCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: PMKCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: PMKCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml new file mode 100644 index 00000000000000..d6813ae51ba754 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RNCONC_1_1.yaml @@ -0,0 +1,323 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-RNCONC-1.1] Global Attributes with DUT as Server + +PICS: + - RNCONC.S + +config: + nodeId: 0x12344321 + cluster: "Radon Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: RNCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: "Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: "Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: "Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && RNCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct + bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: RNCONC.S.Afffc && !RNCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.A0007 && RNCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when RNCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + RNCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when RNCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when RNCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && RNCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + RNCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: RNCONC.S.Afffb && !RNCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: RNCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: RNCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: RNCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml new file mode 100644 index 00000000000000..ec39982a78a0e5 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-RNCONC-2.1] Attributes with server as DUT + +PICS: + - RNCONC.S + +config: + nodeId: 0x12344321 + cluster: "Radon Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: RNCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: RNCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: RNCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: RNCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: RNCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: RNCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: RNCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: RNCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: RNCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: RNCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml new file mode 100644 index 00000000000000..e30bc5768c025e --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TVOCCONC_1_1.yaml @@ -0,0 +1,326 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.1. [TC-TVOCCONC-1.1] Global Attributes with DUT as Server + +PICS: + - TVOCCONC.S + +config: + nodeId: 0x12344321 + cluster: "Total Volatile Organic Compounds Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + PICS: TVOCCONC.S.Afffd + response: + value: 1 + constraints: + type: int16u + + # TODO: Re-enable when #27248 is fixed + - label: + "Read the global attribute: FeatureMap and check for either bit 0 or 1 + set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc + response: + constraints: + type: bitmap32 + hasMasksSet: [0x03] + disabled: true + + - label: + "Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F00 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + - label: + "Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F01 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x2] + + - label: + "Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4, 0x2] + + - label: + "Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F02 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x4] + + - label: + "Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8, 0x2] + + - label: + "Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F03 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x8] + + - label: + "Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10, 0x1] + + - label: + "Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F04 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x10] + + - label: + "Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && TVOCCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x20, 0x1] + + - label: + "Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the + correct bit clear" + command: "readAttribute" + attribute: "FeatureMap" + PICS: TVOCCONC.S.Afffc && !TVOCCONC.S.F05 + response: + constraints: + type: bitmap32 + hasMasksClear: [0x20] + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb + response: + constraints: + type: list + contains: [9, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute Uncertainty in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.A0007 && TVOCCONC.S.F00 + response: + constraints: + type: list + contains: [7] + + - label: + "Check the optional attribute Uncertainty is excluded from + AttributeList when TVOCCONC.S.A0007 is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.A0007 + response: + constraints: + type: list + excludes: [7] + + - label: + "Read the optional, feature dependent attributes MeasuredValue, + MinMeasuredValue, MaxMeasuredValue and Measurement Unit in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F00 + response: + constraints: + type: list + contains: [0, 1, 2, 8] + + - label: + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, + Measurement Unit and Uncertainty are excluded from AttributeList when + TVOCCONC.S.F00 (MEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F00 + response: + constraints: + type: list + excludes: [0, 1, 2, 7, 8] + + - label: + "Read the optional, feature dependent attributes PeakMeasuredValue & + PeakMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F04 + response: + constraints: + type: list + contains: [3, 4] + + - label: + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded + from AttributeList when TVOCCONC.S.F04 (PEA) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F04 + response: + constraints: + type: list + excludes: [3, 4] + + - label: + "Read the optional, feature dependent attributes AverageMeasuredValue + AverageMeasuredValueWindow in AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F05 + response: + constraints: + type: list + contains: [5, 6] + + - label: + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are + excluded from AttributeList when TVOCCONC.S.F05 (AVG) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F05 + response: + constraints: + type: list + excludes: [5, 6] + + - label: + "Read the optional, feature dependent attribute LevelValue in + AttributeList" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && TVOCCONC.S.F01 + response: + constraints: + type: list + contains: [10] + + - label: + "Check that LevelValue is excluded from AttributeList when + TVOCCONC.S.F01 (LEV) is not set" + command: "readAttribute" + attribute: "AttributeList" + PICS: TVOCCONC.S.Afffb && !TVOCCONC.S.F01 + response: + constraints: + type: list + excludes: [10] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + PICS: TVOCCONC.S.Afffa + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + PICS: TVOCCONC.S.Afff9 + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + command: "readAttribute" + attribute: "GeneratedCommandList" + PICS: TVOCCONC.S.Afff8 + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml new file mode 100644 index 00000000000000..d249a0ff8e5fe6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml @@ -0,0 +1,132 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 145.1.2. [TC-TVOCCONC-2.1] Attributes with server as DUT + +PICS: + - TVOCCONC.S + +config: + nodeId: 0x12344321 + cluster: "Total Volatile Organic Compounds Concentration Measurement" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the MinMeasuredValue attribute." + PICS: TVOCCONC.S.A0001 + command: "readAttribute" + attribute: "MinMeasuredValue" + response: + saveAs: MinMeasuredValue + constraints: + type: single + minValue: 0 + + - label: "TH reads from the DUT the MaxMeasuredValue attribute." + PICS: TVOCCONC.S.A0002 + command: "readAttribute" + attribute: "MaxMeasuredValue" + response: + saveAs: MaxMeasuredValue + constraints: + type: single + minValue: MinMeasuredValue + + - label: "TH reads from the DUT the MeasuredValue attribute." + PICS: TVOCCONC.S.A0000 + command: "readAttribute" + attribute: "MeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValue attribute." + PICS: TVOCCONC.S.A0003 + command: "readAttribute" + attribute: "PeakMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the PeakMeasuredValueWindow attribute." + PICS: TVOCCONC.S.A0004 + command: "readAttribute" + attribute: "PeakMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the AverageMeasuredValue attribute." + PICS: TVOCCONC.S.A0005 + command: "readAttribute" + attribute: "AverageMeasuredValue" + response: + constraints: + type: single + minValue: MinMeasuredValue + maxValue: MaxMeasuredValue + + - label: "TH reads from the DUT the AverageMeasuredValueWindow attribute." + PICS: TVOCCONC.S.A0006 + command: "readAttribute" + attribute: "AverageMeasuredValueWindow" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 259200 + + - label: "TH reads from the DUT the MeasurementUnit attribute." + PICS: TVOCCONC.S.A0008 + command: "readAttribute" + attribute: "MeasurementUnit" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 7 + + - label: "TH reads from the DUT the MeasurementMedium attribute." + PICS: TVOCCONC.S.A0009 + command: "readAttribute" + attribute: "MeasurementMedium" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 2 + + - label: "TH reads from the DUT the LevelValue attribute." + PICS: TVOCCONC.S.A000a + command: "readAttribute" + attribute: "LevelValue" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index c80574b3b2d6fa..bc2daf1bc488b6 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2242,3 +2242,290 @@ AIRQUAL.S.F03=1 AIRQUAL.S.A0000=1 PICS_USER_PROMPT=0 AIRQUAL.M.AirQualityChange=0 + +# Concentration Measurement +CDOCONC.C=0 +CDOCONC.S=1 +CDOCONC.S.F00=1 +CDOCONC.S.F01=1 +CDOCONC.S.F02=1 +CDOCONC.S.F03=1 +CDOCONC.S.F04=1 +CDOCONC.S.F05=1 +CDOCONC.S.A0000=1 +CDOCONC.S.A0001=1 +CDOCONC.S.A0002=1 +CDOCONC.S.A0003=1 +CDOCONC.S.A0004=1 +CDOCONC.S.A0005=1 +CDOCONC.S.A0006=1 +CDOCONC.S.A0007=1 +CDOCONC.S.A0008=1 +CDOCONC.S.A0009=1 +CDOCONC.S.A000a=1 +CDOCONC.S.Afff8=1 +CDOCONC.S.Afff9=1 +CDOCONC.S.Afffa=1 +CDOCONC.S.Afffb=1 +CDOCONC.S.Afffc=1 +CDOCONC.S.Afffd=1 + +CMOCONC.C=0 +CMOCONC.S=1 +CMOCONC.S.F00=1 +CMOCONC.S.F01=1 +CMOCONC.S.F02=1 +CMOCONC.S.F03=1 +CMOCONC.S.F04=1 +CMOCONC.S.F05=1 +CMOCONC.S.A0000=1 +CMOCONC.S.A0001=1 +CMOCONC.S.A0002=1 +CMOCONC.S.A0003=1 +CMOCONC.S.A0004=1 +CMOCONC.S.A0005=1 +CMOCONC.S.A0006=1 +CMOCONC.S.A0007=1 +CMOCONC.S.A0008=1 +CMOCONC.S.A0009=1 +CMOCONC.S.A000a=1 +CMOCONC.S.Afff8=1 +CMOCONC.S.Afff9=1 +CMOCONC.S.Afffa=1 +CMOCONC.S.Afffb=1 +CMOCONC.S.Afffc=1 +CMOCONC.S.Afffd=1 + +CMOCONC.C=0 +CMOCONC.S=1 +CMOCONC.S.F00=1 +CMOCONC.S.F01=1 +CMOCONC.S.F02=1 +CMOCONC.S.F03=1 +CMOCONC.S.F04=1 +CMOCONC.S.F05=1 +CMOCONC.S.A0000=1 +CMOCONC.S.A0001=1 +CMOCONC.S.A0002=1 +CMOCONC.S.A0003=1 +CMOCONC.S.A0004=1 +CMOCONC.S.A0005=1 +CMOCONC.S.A0006=1 +CMOCONC.S.A0007=1 +CMOCONC.S.A0008=1 +CMOCONC.S.A0009=1 +CMOCONC.S.A000a=1 +CMOCONC.S.Afff8=1 +CMOCONC.S.Afff9=1 +CMOCONC.S.Afffa=1 +CMOCONC.S.Afffb=1 +CMOCONC.S.Afffc=1 +CMOCONC.S.Afffd=1 + +NDOCONC.C=0 +NDOCONC.S=1 +NDOCONC.S.F00=1 +NDOCONC.S.F01=1 +NDOCONC.S.F02=1 +NDOCONC.S.F03=1 +NDOCONC.S.F04=1 +NDOCONC.S.F05=1 +NDOCONC.S.A0000=1 +NDOCONC.S.A0001=1 +NDOCONC.S.A0002=1 +NDOCONC.S.A0003=1 +NDOCONC.S.A0004=1 +NDOCONC.S.A0005=1 +NDOCONC.S.A0006=1 +NDOCONC.S.A0007=1 +NDOCONC.S.A0008=1 +NDOCONC.S.A0009=1 +NDOCONC.S.A000a=1 +NDOCONC.S.Afff8=1 +NDOCONC.S.Afff9=1 +NDOCONC.S.Afffa=1 +NDOCONC.S.Afffb=1 +NDOCONC.S.Afffc=1 +NDOCONC.S.Afffd=1 + +OZCONC.C=0 +OZCONC.S=1 +OZCONC.S.F00=1 +OZCONC.S.F01=1 +OZCONC.S.F02=1 +OZCONC.S.F03=1 +OZCONC.S.F04=1 +OZCONC.S.F05=1 +OZCONC.S.A0000=1 +OZCONC.S.A0001=1 +OZCONC.S.A0002=1 +OZCONC.S.A0003=1 +OZCONC.S.A0004=1 +OZCONC.S.A0005=1 +OZCONC.S.A0006=1 +OZCONC.S.A0007=1 +OZCONC.S.A0008=1 +OZCONC.S.A0009=1 +OZCONC.S.A000a=1 +OZCONC.S.Afff8=1 +OZCONC.S.Afff9=1 +OZCONC.S.Afffa=1 +OZCONC.S.Afffb=1 +OZCONC.S.Afffc=1 +OZCONC.S.Afffd=1 + +PMICONC.C=0 +PMICONC.S=1 +PMICONC.S.F00=1 +PMICONC.S.F01=1 +PMICONC.S.F02=1 +PMICONC.S.F03=1 +PMICONC.S.F04=1 +PMICONC.S.F05=1 +PMICONC.S.A0000=1 +PMICONC.S.A0001=1 +PMICONC.S.A0002=1 +PMICONC.S.A0003=1 +PMICONC.S.A0004=1 +PMICONC.S.A0005=1 +PMICONC.S.A0006=1 +PMICONC.S.A0007=1 +PMICONC.S.A0008=1 +PMICONC.S.A0009=1 +PMICONC.S.A000a=1 +PMICONC.S.Afff8=1 +PMICONC.S.Afff9=1 +PMICONC.S.Afffa=1 +PMICONC.S.Afffb=1 +PMICONC.S.Afffc=1 +PMICONC.S.Afffd=1 + +FLDCONC.C=0 +FLDCONC.S=1 +FLDCONC.S.F00=1 +FLDCONC.S.F01=1 +FLDCONC.S.F02=1 +FLDCONC.S.F03=1 +FLDCONC.S.F04=1 +FLDCONC.S.F05=1 +FLDCONC.S.A0000=1 +FLDCONC.S.A0001=1 +FLDCONC.S.A0002=1 +FLDCONC.S.A0003=1 +FLDCONC.S.A0004=1 +FLDCONC.S.A0005=1 +FLDCONC.S.A0006=1 +FLDCONC.S.A0007=1 +FLDCONC.S.A0008=1 +FLDCONC.S.A0009=1 +FLDCONC.S.A000a=1 +FLDCONC.S.Afff8=1 +FLDCONC.S.Afff9=1 +FLDCONC.S.Afffa=1 +FLDCONC.S.Afffb=1 +FLDCONC.S.Afffc=1 +FLDCONC.S.Afffd=1 + +PMHCONC.C=0 +PMHCONC.S=1 +PMHCONC.S.F00=1 +PMHCONC.S.F01=1 +PMHCONC.S.F02=1 +PMHCONC.S.F03=1 +PMHCONC.S.F04=1 +PMHCONC.S.F05=1 +PMHCONC.S.A0000=1 +PMHCONC.S.A0001=1 +PMHCONC.S.A0002=1 +PMHCONC.S.A0003=1 +PMHCONC.S.A0004=1 +PMHCONC.S.A0005=1 +PMHCONC.S.A0006=1 +PMHCONC.S.A0007=1 +PMHCONC.S.A0008=1 +PMHCONC.S.A0009=1 +PMHCONC.S.A000a=1 +PMHCONC.S.Afff8=1 +PMHCONC.S.Afff9=1 +PMHCONC.S.Afffa=1 +PMHCONC.S.Afffb=1 +PMHCONC.S.Afffc=1 +PMHCONC.S.Afffd=1 + +PMKCONC.C=0 +PMKCONC.S=1 +PMKCONC.S.F00=1 +PMKCONC.S.F01=1 +PMKCONC.S.F02=1 +PMKCONC.S.F03=1 +PMKCONC.S.F04=1 +PMKCONC.S.F05=1 +PMKCONC.S.A0000=1 +PMKCONC.S.A0001=1 +PMKCONC.S.A0002=1 +PMKCONC.S.A0003=1 +PMKCONC.S.A0004=1 +PMKCONC.S.A0005=1 +PMKCONC.S.A0006=1 +PMKCONC.S.A0007=1 +PMKCONC.S.A0008=1 +PMKCONC.S.A0009=1 +PMKCONC.S.A000a=1 +PMKCONC.S.Afff8=1 +PMKCONC.S.Afff9=1 +PMKCONC.S.Afffa=1 +PMKCONC.S.Afffb=1 +PMKCONC.S.Afffc=1 +PMKCONC.S.Afffd=1 + +TVOCCONC.C=0 +TVOCCONC.S=1 +TVOCCONC.S.F00=1 +TVOCCONC.S.F01=1 +TVOCCONC.S.F02=1 +TVOCCONC.S.F03=1 +TVOCCONC.S.F04=1 +TVOCCONC.S.F05=1 +TVOCCONC.S.A0000=1 +TVOCCONC.S.A0001=1 +TVOCCONC.S.A0002=1 +TVOCCONC.S.A0003=1 +TVOCCONC.S.A0004=1 +TVOCCONC.S.A0005=1 +TVOCCONC.S.A0006=1 +TVOCCONC.S.A0007=1 +TVOCCONC.S.A0008=1 +TVOCCONC.S.A0009=1 +TVOCCONC.S.A000a=1 +TVOCCONC.S.Afff8=1 +TVOCCONC.S.Afff9=1 +TVOCCONC.S.Afffa=1 +TVOCCONC.S.Afffb=1 +TVOCCONC.S.Afffc=1 +TVOCCONC.S.Afffd=1 + +RNCONC.C=0 +RNCONC.S=1 +RNCONC.S.F00=1 +RNCONC.S.F01=1 +RNCONC.S.F02=1 +RNCONC.S.F03=1 +RNCONC.S.F04=1 +RNCONC.S.F05=1 +RNCONC.S.A0000=1 +RNCONC.S.A0001=1 +RNCONC.S.A0002=1 +RNCONC.S.A0003=1 +RNCONC.S.A0004=1 +RNCONC.S.A0005=1 +RNCONC.S.A0006=1 +RNCONC.S.A0007=1 +RNCONC.S.A0008=1 +RNCONC.S.A0009=1 +RNCONC.S.A000a=1 +RNCONC.S.Afff8=1 +RNCONC.S.Afff9=1 +RNCONC.S.Afffa=1 +RNCONC.S.Afffb=1 +RNCONC.S.Afffc=1 +RNCONC.S.Afffd=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 80a913df8b3765..156d22d600efe8 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -301,6 +301,28 @@ "Test_TC_ZEOFREMON_2_1" ], "AirQuality": ["Test_TC_AIRQUAL_1_1", "Test_TC_AIRQUAL_2_1"], + "ConcentrationMeasurement": [ + "Test_TC_CDOCONC_1_1", + "Test_TC_CDOCONC_2_1", + "Test_TC_CMOCONC_1_1", + "Test_TC_CMOCONC_2_1", + "Test_TC_FLDCONC_1_1", + "Test_TC_FLDCONC_2_1", + "Test_TC_NDOCONC_1_1", + "Test_TC_NDOCONC_2_1", + "Test_TC_OZCONC_1_1", + "Test_TC_OZCONC_2_1", + "Test_TC_PMHCONC_1_1", + "Test_TC_PMHCONC_2_1", + "Test_TC_PMICONC_1_1", + "Test_TC_PMICONC_2_1", + "Test_TC_PMKCONC_1_1", + "Test_TC_PMKCONC_2_1", + "Test_TC_RNCONC_1_1", + "Test_TC_RNCONC_2_1", + "Test_TC_TVOCCONC_1_1", + "Test_TC_TVOCCONC_2_1" + ], "collection": [ "AccessControl", "AccessControlEnforcement", @@ -310,6 +332,7 @@ "Actions", "Binding", "ColorControl", + "ConcentrationMeasurement", "DeviceManagement", "Descriptor", "DiagnosticsLogs", diff --git a/src/controller/python/chip/yaml/runner.py b/src/controller/python/chip/yaml/runner.py index bd5dbf99ded8a7..2e21f5eefd7d02 100644 --- a/src/controller/python/chip/yaml/runner.py +++ b/src/controller/python/chip/yaml/runner.py @@ -837,7 +837,7 @@ def _default_pseudo_cluster(self, test_step): def encode(self, request) -> BaseAction: action = None - cluster = request.cluster.replace(' ', '').replace('/', '') + cluster = request.cluster.replace(' ', '').replace('/', '').replace('.', '') command = request.command if cluster == 'CommissionerCommands': return self._commissioner_command_action_factory(request) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index bd8f0f92d82a80..32ce455574153a 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -75,6 +75,26 @@ class TestList : public Command printf("Test_TC_CC_8_1\n"); printf("TestColorControl_9_1\n"); printf("TestColorControl_9_2\n"); + printf("Test_TC_CDOCONC_1_1\n"); + printf("Test_TC_CDOCONC_2_1\n"); + printf("Test_TC_CMOCONC_1_1\n"); + printf("Test_TC_CMOCONC_2_1\n"); + printf("Test_TC_FLDCONC_1_1\n"); + printf("Test_TC_FLDCONC_2_1\n"); + printf("Test_TC_NDOCONC_1_1\n"); + printf("Test_TC_NDOCONC_2_1\n"); + printf("Test_TC_OZCONC_1_1\n"); + printf("Test_TC_OZCONC_2_1\n"); + printf("Test_TC_PMHCONC_1_1\n"); + printf("Test_TC_PMHCONC_2_1\n"); + printf("Test_TC_PMICONC_1_1\n"); + printf("Test_TC_PMICONC_2_1\n"); + printf("Test_TC_PMKCONC_1_1\n"); + printf("Test_TC_PMKCONC_2_1\n"); + printf("Test_TC_RNCONC_1_1\n"); + printf("Test_TC_RNCONC_2_1\n"); + printf("Test_TC_TVOCCONC_1_1\n"); + printf("Test_TC_TVOCCONC_2_1\n"); printf("TestIcdManagementCluster\n"); printf("Test_TC_OPCREDS_1_2\n"); printf("Test_TC_BINFO_1_1\n"); @@ -23006,6 +23026,7535 @@ class TestColorControl_9_2Suite : public TestCommand } }; +class Test_TC_CDOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_CDOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CDOCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CDOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.A0007 && CDOCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when CDOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when CDOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CDOCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "CDOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("CDOCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CDOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_CDOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CDOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CDOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("CDOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonDioxideConcentrationMeasurement::Id, + CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_CMOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CMOCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CMOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.A0007 && CMOCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when CMOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when CMOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CMOCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "CMOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("CMOCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_CMOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CMOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CMOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("CMOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), CarbonMonoxideConcentrationMeasurement::Id, + CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_FLDCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLDCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLDCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.A0007 && FLDCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when FLDCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when FLDCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when FLDCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "FLDCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("FLDCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_FLDCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_FLDCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_FLDCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("FLDCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), FormaldehydeConcentrationMeasurement::Id, + FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_NDOCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_NDOCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_NDOCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.A0007 && NDOCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when NDOCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when NDOCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when NDOCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "NDOCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("NDOCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_NDOCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_NDOCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_NDOCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("NDOCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), NitrogenDioxideConcentrationMeasurement::Id, + NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_OZCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OZCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.A0007 && OZCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when OZCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when OZCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "OZCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("OZCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_OZCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_OZCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OZCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::OzoneConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("OZCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OzoneConcentrationMeasurement::Id, + OzoneConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMHCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMHCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMHCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.A0007 && PMHCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when PMHCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when PMHCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMHCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMHCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("PMHCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMHCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMHCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMHCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm1ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMHCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm1ConcentrationMeasurement::Id, + Pm1ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMICONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMICONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMICONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.A0007 && PMICONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when PMICONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when PMICONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMICONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMICONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("PMICONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMICONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMICONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMICONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm25ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMICONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm25ConcentrationMeasurement::Id, + Pm25ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_PMKCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMKCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMKCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.A0007 && PMKCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when PMKCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when PMKCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMKCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "PMKCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("PMKCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_PMKCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_PMKCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_PMKCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Pm10ConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("PMKCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Pm10ConcentrationMeasurement::Id, + Pm10ConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_RNCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RNCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RNCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.A0007 && RNCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when RNCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when RNCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "RNCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::EventList::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("RNCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_RNCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_RNCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_RNCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::RadonConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasuredValue::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("RNCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), RadonConcentrationMeasurement::Id, + RadonConcentrationMeasurement::Attributes::LevelValue::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_1_1Suite : public TestCommand +{ +public: + Test_TC_TVOCCONC_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TVOCCONC_1_1", 28, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TVOCCONC_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 4UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 4UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 8UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 16UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 16UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 32UL)); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 1UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksClear("value", value, 32UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 8UL)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 4UL)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("value", value, 6UL)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("value", value, 10UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffd"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 8: { + LogStep(8, "Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 12: { + LogStep(12, "Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Read the global attribute: AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 15: { + LogStep(15, "Read the optional attribute Uncertainty in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.A0007 && TVOCCONC.S.F00"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 16: { + LogStep(16, "Check the optional attribute Uncertainty is excluded from AttributeList when TVOCCONC.S.A0007 is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 17: { + LogStep(17, + "Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + "Measurement Unit in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, + "Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + "from AttributeList when TVOCCONC.S.F00 (MEA) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, + "Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 20: { + LogStep(20, + "Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when TVOCCONC.S.F04 " + "(PEA) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F04"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 21: { + LogStep( + 21, + "Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 22: { + LogStep(22, + "Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + "TVOCCONC.S.F05 (AVG) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F05"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 23: { + LogStep(23, "Read the optional, feature dependent attribute LevelValue in AttributeList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 24: { + LogStep(24, "Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not set"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 25: { + LogStep(25, "Read the global attribute: EventList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afffa"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 26: { + LogStep(26, "Read the global attribute: AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afff9"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.Afff8"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_2_1Suite : public TestCommand +{ +public: + Test_TC_TVOCCONC_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TVOCCONC_2_1", 11, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TVOCCONC_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::app::DataModel::Nullable MinMeasuredValue; + chip::app::DataModel::Nullable MaxMeasuredValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0.0f)); + MinMeasuredValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + MaxMeasuredValue = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 259200UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementUnitEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 7U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementMediumEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::LevelValueEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the MinMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the MaxMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the MeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the PeakMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the PeakMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the AverageMeasuredValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads from the DUT the AverageMeasuredValueWindow attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0006"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads from the DUT the MeasurementUnit attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads from the DUT the MeasurementMedium attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id, true, + chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads from the DUT the LevelValue attribute."); + VerifyOrDo(!ShouldSkip("TVOCCONC.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class TestIcdManagementClusterSuite : public TestCommand { public: @@ -127130,6 +134679,26 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), 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 019717e676f697..8a3451e3fb84cf 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -66,6 +66,26 @@ class TestList : public Command { printf("Test_TC_CC_7_4\n"); printf("TestColorControl_9_1\n"); printf("TestColorControl_9_2\n"); + printf("Test_TC_CDOCONC_1_1\n"); + printf("Test_TC_CDOCONC_2_1\n"); + printf("Test_TC_CMOCONC_1_1\n"); + printf("Test_TC_CMOCONC_2_1\n"); + printf("Test_TC_FLDCONC_1_1\n"); + printf("Test_TC_FLDCONC_2_1\n"); + printf("Test_TC_NDOCONC_1_1\n"); + printf("Test_TC_NDOCONC_2_1\n"); + printf("Test_TC_OZCONC_1_1\n"); + printf("Test_TC_OZCONC_2_1\n"); + printf("Test_TC_PMHCONC_1_1\n"); + printf("Test_TC_PMHCONC_2_1\n"); + printf("Test_TC_PMICONC_1_1\n"); + printf("Test_TC_PMICONC_2_1\n"); + printf("Test_TC_PMKCONC_1_1\n"); + printf("Test_TC_PMKCONC_2_1\n"); + printf("Test_TC_RNCONC_1_1\n"); + printf("Test_TC_RNCONC_2_1\n"); + printf("Test_TC_TVOCCONC_1_1\n"); + printf("Test_TC_TVOCCONC_2_1\n"); printf("Test_TC_OPCREDS_1_2\n"); printf("Test_TC_BINFO_1_1\n"); printf("Test_TC_CNET_1_3\n"); @@ -26826,6 +26846,15091 @@ class TestColorControl_9_2 : public TestCommandBridge { } }; +class Test_TC_CDOCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CDOCONC_1_1() + : TestCommandBridge("Test_TC_CDOCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CDOCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CDOCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CDOCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("CDOCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CDOCONC.S.Afffc && CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CDOCONC.S.Afffc && !CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.A0007 && CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "CDOCONC.S.A0007 is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCdoconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when CDOCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCdoconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "CDOCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when CDOCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("CDOCONC.S.Afffb && CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("CDOCONC.S.Afffb && !CDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenCdoconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("CDOCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("CDOCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("CDOCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCdoconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when CDOCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCdoconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when CDOCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CDOCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCdoconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"CDOCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenCdoconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when CDOCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CDOCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CDOCONC_2_1() + : TestCommandBridge("Test_TC_CDOCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CDOCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CDOCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CDOCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("CDOCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("CDOCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CMOCONC_1_1() + : TestCommandBridge("Test_TC_CMOCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CMOCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CMOCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CMOCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("CMOCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("CMOCONC.S.Afffc && CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("CMOCONC.S.Afffc && !CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenCmoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.A0007 && CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "CMOCONC.S.A0007 is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCmoconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when CMOCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCmoconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "CMOCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when CMOCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("CMOCONC.S.Afffb && CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("CMOCONC.S.Afffb && !CMOCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenCmoconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("CMOCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("CMOCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("CMOCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenCmoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given CMOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenCmoconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when CMOCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenCmoconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when CMOCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when CMOCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenCmoconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"CMOCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenCmoconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when CMOCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CMOCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CMOCONC_2_1() + : TestCommandBridge("Test_TC_CMOCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CMOCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CMOCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CMOCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("CMOCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("CMOCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterCarbonMonoxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_FLDCONC_1_1() + : TestCommandBridge("Test_TC_FLDCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_FLDCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLDCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLDCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("FLDCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenFldconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenFldconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenFldconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenFldconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenFldconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenFldconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenFldconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenFldconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenFldconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenFldconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("FLDCONC.S.Afffc && FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenFldconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("FLDCONC.S.Afffc && !FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenFldconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.A0007 && FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "FLDCONC.S.A0007 is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenFldconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when FLDCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenFldconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "FLDCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when FLDCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("FLDCONC.S.Afffb && FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("FLDCONC.S.Afffb && !FLDCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenFldconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("FLDCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("FLDCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("FLDCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenFldconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given FLDCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenFldconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when FLDCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenFldconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when FLDCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when FLDCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenFldconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"FLDCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenFldconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when FLDCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_FLDCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_FLDCONC_2_1() + : TestCommandBridge("Test_TC_FLDCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_FLDCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_FLDCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_FLDCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("FLDCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("FLDCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterFormaldehydeConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_NDOCONC_1_1() + : TestCommandBridge("Test_TC_NDOCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_NDOCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_NDOCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_NDOCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("NDOCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("NDOCONC.S.Afffc && NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("NDOCONC.S.Afffc && !NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenNdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.A0007 && NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "NDOCONC.S.A0007 is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenNdoconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when NDOCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenNdoconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "NDOCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when NDOCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("NDOCONC.S.Afffb && NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("NDOCONC.S.Afffb && !NDOCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenNdoconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("NDOCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("NDOCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("NDOCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenNdoconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given NDOCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenNdoconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when NDOCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenNdoconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when NDOCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when NDOCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenNdoconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"NDOCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenNdoconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when NDOCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_NDOCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_NDOCONC_2_1() + : TestCommandBridge("Test_TC_NDOCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_NDOCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_NDOCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_NDOCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("NDOCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("NDOCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNitrogenDioxideConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OZCONC_1_1() + : TestCommandBridge("Test_TC_OZCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OZCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OZCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OZCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("OZCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenOzconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenOzconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenOzconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenOzconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenOzconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenOzconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenOzconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenOzconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenOzconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenOzconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("OZCONC.S.Afffc && OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenOzconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("OZCONC.S.Afffc && !OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenOzconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.A0007 && OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 " + "is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenOzconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when OZCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenOzconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "OZCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when OZCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("OZCONC.S.Afffb && OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("OZCONC.S.Afffb && !OZCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenOzconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("OZCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("OZCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("OZCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenOzconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given OZCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenOzconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Check the optional attribute Uncertainty is excluded from AttributeList when OZCONC.S.A0007 is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenOzconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when OZCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when OZCONC.S.F04 (PEA) " + @"is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenOzconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"OZCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenOzconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when OZCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_OZCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OZCONC_2_1() + : TestCommandBridge("Test_TC_OZCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OZCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OZCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OZCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("OZCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("OZCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("OZCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("OZCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("OZCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOzoneConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMHCONC_1_1() + : TestCommandBridge("Test_TC_PMHCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMHCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMHCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMHCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("PMHCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMHCONC.S.Afffc && PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMHCONC.S.Afffc && !PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmhconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.A0007 && PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "PMHCONC.S.A0007 is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmhconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when PMHCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmhconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMHCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when PMHCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("PMHCONC.S.Afffb && PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("PMHCONC.S.Afffb && !PMHCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmhconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("PMHCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PMHCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PMHCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmhconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMHCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmhconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when PMHCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmhconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when PMHCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMHCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmhconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"PMHCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmhconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when PMHCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMHCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMHCONC_2_1() + : TestCommandBridge("Test_TC_PMHCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMHCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMHCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMHCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("PMHCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("PMHCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM1ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMICONC_1_1() + : TestCommandBridge("Test_TC_PMICONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMICONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMICONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMICONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("PMICONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMICONC.S.Afffc && PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMICONC.S.Afffc && !PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmiconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.A0007 && PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "PMICONC.S.A0007 is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmiconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when PMICONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmiconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMICONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when PMICONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("PMICONC.S.Afffb && PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("PMICONC.S.Afffb && !PMICONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmiconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("PMICONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PMICONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PMICONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmiconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMICONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmiconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when PMICONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmiconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when PMICONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMICONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmiconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"PMICONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmiconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when PMICONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMICONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMICONC_2_1() + : TestCommandBridge("Test_TC_PMICONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMICONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMICONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMICONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMICONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMICONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("PMICONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("PMICONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("PMICONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM25ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMKCONC_1_1() + : TestCommandBridge("Test_TC_PMKCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMKCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMKCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMKCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("PMKCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("PMKCONC.S.Afffc && PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("PMKCONC.S.Afffc && !PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenPmkconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.A0007 && PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "PMKCONC.S.A0007 is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmkconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when PMKCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmkconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "PMKCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when PMKCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("PMKCONC.S.Afffb && PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("PMKCONC.S.Afffb && !PMKCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmkconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("PMKCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("PMKCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("PMKCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenPmkconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given PMKCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenPmkconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when PMKCONC.S.A0007 is not set Error: " + @"%@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenPmkconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when PMKCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when PMKCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenPmkconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"PMKCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenPmkconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when PMKCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PMKCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PMKCONC_2_1() + : TestCommandBridge("Test_TC_PMKCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_PMKCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PMKCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PMKCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("PMKCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("PMKCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterPM10ConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_RNCONC_1_1() + : TestCommandBridge("Test_TC_RNCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_RNCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RNCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RNCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("RNCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenRnconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenRnconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenRnconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenRnconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenRnconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenRnconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenRnconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenRnconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenRnconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenRnconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("RNCONC.S.Afffc && RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenRnconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("RNCONC.S.Afffc && !RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenRnconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.A0007 && RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 " + "is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenRnconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when RNCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenRnconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "RNCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when RNCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("RNCONC.S.Afffb && RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set\n"); + if (ShouldSkip("RNCONC.S.Afffb && !RNCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenRnconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("RNCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("RNCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("RNCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenRnconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given RNCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenRnconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Check the optional attribute Uncertainty is excluded from AttributeList when RNCONC.S.A0007 is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenRnconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when RNCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when RNCONC.S.F04 (PEA) " + @"is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenRnconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"RNCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenRnconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when RNCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_RNCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_RNCONC_2_1() + : TestCommandBridge("Test_TC_RNCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_RNCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RNCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RNCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("RNCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("RNCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("RNCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("RNCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("RNCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRadonConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TVOCCONC_1_1() + : TestCommandBridge("Test_TC_TVOCCONC_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TVOCCONC_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TVOCCONC_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TVOCCONC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + if (ShouldSkip("TVOCCONC.S.Afffd")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F02")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F03")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11(); + break; + case 12: + ChipLogProgress( + chipTool, " ***** Test Step 12 : Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear\n"); + if (ShouldSkip("TVOCCONC.S.Afffc && !TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestGivenTvocconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Read the global attribute: AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read the optional attribute Uncertainty in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.A0007 && TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeUncertaintyInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check the optional attribute Uncertainty is excluded from AttributeList when " + "TVOCCONC.S.A0007 is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.A0007")) { + NextTest(); + return; + } + err = TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenTvocconcsa0007IsNotSet_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, " + "MaxMeasuredValue and Measurement Unit in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and " + "Uncertainty are excluded from AttributeList when TVOCCONC.S.F00 (MEA) is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F00")) { + NextTest(); + return; + } + err = TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenTvocconcsf00MeaIsNotSet_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow " + "in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when " + "TVOCCONC.S.F04 (PEA) is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F04")) { + NextTest(); + return; + } + err = TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf04PeaIsNotSet_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read the optional, feature dependent attributes AverageMeasuredValue " + "AverageMeasuredValueWindow in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from " + "AttributeList when TVOCCONC.S.F05 (AVG) is not set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F05")) { + NextTest(); + return; + } + err = TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf05AvgIsNotSet_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Read the optional, feature dependent attribute LevelValue in AttributeList\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not " + "set\n"); + if (ShouldSkip("TVOCCONC.S.Afffb && !TVOCCONC.S.F01")) { + NextTest(); + return; + } + err = TestCheckThatLevelValueIsExcludedFromAttributeListWhenTvocconcsf01LevIsNotSet_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read the global attribute: EventList\n"); + if (ShouldSkip("TVOCCONC.S.Afffa")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeEventList_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Read the global attribute: AcceptedCommandList\n"); + if (ShouldSkip("TVOCCONC.S.Afff9")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeAcceptedCommandList_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("TVOCCONC.S.Afff8")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_27(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 28; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf00meaEnsureFeaturemapHasTheCorrectBitSet_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F00(MEA) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf00meaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F00(MEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf01levEnsureFeaturemapHasTheCorrectBitSet_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F01(LEV) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf01levIsNotSetEnsureFeaturemapHasTheCorrectBitClear_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F01(LEV) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf02medEnsureFeaturemapHasTheCorrectBitSet_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F02(MED) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf02medIsNotSetEnsureFeaturemapHasTheCorrectBitClear_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F02(MED) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf03criEnsureFeaturemapHasTheCorrectBitsSet_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F03(CRI) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf03criIsNotSetEnsureFeaturemapHasTheCorrectBitClear_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F03(CRI) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf04peaEnsureFeaturemapHasTheCorrectBitsSet_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F04(PEA) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf04peaIsNotSetEnsureFeaturemapHasTheCorrectBitClear_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F04(PEA) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf05avgEnsureFeaturemapHasTheCorrectBitsSet_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F05(AVG) ensure featuremap has the correct bits set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGivenTvocconcsf05avgIsNotSetEnsureFeaturemapHasTheCorrectBitClear_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Given TVOCCONC.S.F05(AVG) is not set, ensure featuremap has the correct bit clear Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeUncertaintyInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute Uncertainty in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckTheOptionalAttributeUncertaintyIsExcludedFromAttributeListWhenTvocconcsa0007IsNotSet_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check the optional attribute Uncertainty is excluded from AttributeList when TVOCCONC.S.A0007 is not set " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestReadTheOptionalFeatureDependentAttributesMeasuredValueMinMeasuredValueMaxMeasuredValueAndMeasurementUnitInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes MeasuredValue, MinMeasuredValue, MaxMeasuredValue and " + @"Measurement Unit in AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatMeasuredValueMinMeasuredValueMaxMeasuredValueMeasurementUnitAndUncertaintyAreExcludedFromAttributeListWhenTvocconcsf00MeaIsNotSet_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that MeasuredValue, MinMeasuredValue, MaxMeasuredValue, Measurement Unit and Uncertainty are excluded " + @"from AttributeList when TVOCCONC.S.F00 (MEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesPeakMeasuredValuePeakMeasuredValueWindowInAttributeList_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes PeakMeasuredValue & PeakMeasuredValueWindow in AttributeList " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatPeakMeasuredValuePeakMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf04PeaIsNotSet_20() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that PeakMeasuredValue & PeakMeasuredValueWindow are excluded from AttributeList when TVOCCONC.S.F04 " + @"(PEA) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributesAverageMeasuredValueAverageMeasuredValueWindowInAttributeList_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attributes AverageMeasuredValue AverageMeasuredValueWindow in " + @"AttributeList Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestCheckThatAverageMeasuredValueAndAverageMeasuredValueWindowAreExcludedFromAttributeListWhenTvocconcsf05AvgIsNotSet_22() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that AverageMeasuredValue and AverageMeasuredValueWindow are excluded from AttributeList when " + @"TVOCCONC.S.F05 (AVG) is not set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 6UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalFeatureDependentAttributeLevelValueInAttributeList_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional, feature dependent attribute LevelValue in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckThatLevelValueIsExcludedFromAttributeListWhenTvocconcsf01LevIsNotSet_24() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check that LevelValue is excluded from AttributeList when TVOCCONC.S.F01 (LEV) is not set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeEventList_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: EventList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("EventList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("eventList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_26() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_27() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TVOCCONC_2_1() + : TestCommandBridge("Test_TC_TVOCCONC_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TVOCCONC_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TVOCCONC_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TVOCCONC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads from the DUT the MinMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMinMeasuredValueAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads from the DUT the MaxMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads from the DUT the MeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasuredValueAttribute_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads from the DUT the PeakMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the PeakMeasuredValueWindow attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads from the DUT the AverageMeasuredValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads from the DUT the AverageMeasuredValueWindow attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0006")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads from the DUT the MeasurementUnit attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementUnitAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads from the DUT the MeasurementMedium attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheMeasurementMediumAttribute_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads from the DUT the LevelValue attribute.\n"); + if (ShouldSkip("TVOCCONC.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheLevelValueAttribute_10(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 11; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nullable MinMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMinMeasuredValueAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MinMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); + } + { + MinMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable MaxMeasuredValue; + + CHIP_ERROR TestThReadsFromTheDutTheMaxMeasuredValueAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MaxMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + } + { + MaxMeasuredValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasuredValueAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutThePeakMeasuredValueWindowAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the PeakMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("peakMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheAverageMeasuredValueWindowAttribute_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the AverageMeasuredValueWindow attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("averageMeasuredValueWindow", "elapsed_s", "elapsed_s")); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValueWindow", [value unsignedIntValue], 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValueWindow", [value unsignedIntValue], 259200UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementUnitAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementUnit attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementUnit", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementUnit", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementUnit", [value unsignedCharValue], 7U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheMeasurementMediumAttribute_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the MeasurementMedium attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("measurementMedium", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("measurementMedium", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("measurementMedium", [value unsignedCharValue], 2U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheLevelValueAttribute_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = + [[MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the LevelValue attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("levelValue", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("levelValue", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("levelValue", [value unsignedCharValue], 4U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_OPCREDS_1_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -147995,6 +163100,26 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), From 561d7e15c546794714811c7f4a05488d5a482927 Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:11:15 -0400 Subject: [PATCH 25/31] rename the Robotic Vacuum Operational State cluster (#27273) * rename the Robotic Vacuum Operational State cluster * remove whitespace from json files * style changes * fix a build file --- .gitignore | 1 - .../chip/operational-state-rvc-cluster.xml | 2 +- .../zcl/zcl-with-test-extensions.json | 5 +- src/app/zap-templates/zcl/zcl.json | 5 +- src/controller/data_model/BUILD.gn | 4 +- .../data_model/controller-clusters.matter | 2 +- .../data_model/controller-clusters.zap | 16 +- .../devicecontroller/ClusterIDMapping.java | 6 +- .../devicecontroller/ClusterReadMapping.java | 136 ++--- .../devicecontroller/ClusterWriteMapping.java | 4 +- .../CHIPAttributeTLVValueDecoder.cpp | 26 +- .../java/zap-generated/CHIPClientCallbacks.h | 16 +- .../CHIPEventTLVValueDecoder.cpp | 30 +- .../zap-generated/CHIPInvokeCallbacks.cpp | 33 +- .../java/zap-generated/CHIPInvokeCallbacks.h | 14 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 129 +++-- .../chip/devicecontroller/ChipClusters.java | 8 +- .../devicecontroller/ChipEventStructs.java | 16 +- .../chip/devicecontroller/ChipIdLookup.java | 2 +- .../chip/devicecontroller/ChipStructs.java | 12 +- .../devicecontroller/ClusterInfoMapping.java | 92 ++-- .../python/chip/clusters/CHIPClusters.py | 8 +- .../python/chip/clusters/Objects.py | 34 +- .../MTRAttributeSpecifiedCheck.mm | 8 +- .../MTRAttributeTLVValueDecoder.mm | 20 +- .../CHIP/zap-generated/MTRBaseClusters.h | 89 ++-- .../CHIP/zap-generated/MTRBaseClusters.mm | 255 +++++---- .../zap-generated/MTRBaseClusters_Internal.h | 2 +- .../CHIP/zap-generated/MTRCallbackBridge.h | 442 ++++++++-------- .../CHIP/zap-generated/MTRCallbackBridge.mm | 81 ++- .../CHIP/zap-generated/MTRClusterConstants.h | 46 +- .../CHIP/zap-generated/MTRClusters.h | 28 +- .../CHIP/zap-generated/MTRClusters.mm | 166 +++--- .../CHIP/zap-generated/MTRClusters_Internal.h | 2 +- .../zap-generated/MTRCommandPayloadsObjc.h | 15 +- .../zap-generated/MTRCommandPayloadsObjc.mm | 30 +- .../MTRCommandPayloads_Internal.h | 5 +- .../zap-generated/MTREventTLVValueDecoder.mm | 17 +- .../CHIP/zap-generated/MTRStructsObjc.h | 10 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 18 +- .../zap-generated/attributes/Accessors.cpp | 24 +- .../zap-generated/attributes/Accessors.h | 4 +- .../app-common/zap-generated/callback.h | 63 ++- .../zap-generated/cluster-enums-check.h | 8 +- .../app-common/zap-generated/cluster-enums.h | 4 +- .../zap-generated/cluster-objects.cpp | 6 +- .../zap-generated/cluster-objects.h | 86 ++- .../app-common/zap-generated/ids/Attributes.h | 4 +- .../app-common/zap-generated/ids/Clusters.h | 4 +- .../app-common/zap-generated/ids/Commands.h | 4 +- .../app-common/zap-generated/ids/Events.h | 4 +- .../app-common/zap-generated/print-cluster.h | 3 +- .../zap-generated/cluster/Commands.h | 55 +- .../cluster/logging/DataModelLogger.cpp | 57 +- .../cluster/logging/DataModelLogger.h | 12 +- .../zap-generated/cluster/Commands.h | 493 +++++++++--------- 56 files changed, 1287 insertions(+), 1379 deletions(-) diff --git a/.gitignore b/.gitignore index 21a01b1000a779..4c17bb63a84a8c 100644 --- a/.gitignore +++ b/.gitignore @@ -80,4 +80,3 @@ examples/thermostat/ameba/build # https://github.com/espressif/idf-component-manager#using-with-a-project examples/*/esp32/managed_components examples/*/esp32/dependencies.lock -examples/all-clusters-app/all-clusters-common/all-clusters-app.zap.old diff --git a/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml index c568f3f873871f..94c10eb297a5d3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/operational-state-rvc-cluster.xml @@ -38,7 +38,7 @@ limitations under the License. Robots - Robotic Vacuum Operational State + RVC Operational State 0x0061 OPERATIONAL_STATE_RVC_CLUSTER true diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 3e52c910fe02d5..2e5c502b4ed72a 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -302,10 +302,7 @@ ], "Temperature Control": ["SupportedTemperatureLevels"], "Operational State": ["OperationalState", "OperationalError"], - "Robotic Vacuum Operational State": [ - "OperationalState", - "OperationalError" - ] + "RVC Operational State": ["OperationalState", "OperationalError"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 91567280ea4764..c7459b16080edc 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -300,10 +300,7 @@ ], "Temperature Control": ["SupportedTemperatureLevels"], "Operational State": ["OperationalState", "OperationalError"], - "Robotic Vacuum Operational State": [ - "OperationalState", - "OperationalError" - ] + "RVC Operational State": ["OperationalState", "OperationalError"] }, "defaultReportingPolicy": "mandatory", "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 698c950b3b81d0..3df33e1df39464 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -242,8 +242,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", - "jni/RoboticVacuumOperationalStateClient-InvokeSubscribeImpl.cpp", - "jni/RoboticVacuumOperationalStateClient-ReadImpl.cpp", + "jni/RvcOperationalStateClient-InvokeSubscribeImpl.cpp", + "jni/RvcOperationalStateClient-ReadImpl.cpp", "jni/RvcCleanModeSelectClient-InvokeSubscribeImpl.cpp", "jni/RvcCleanModeSelectClient-ReadImpl.cpp", "jni/RvcRunModeSelectClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 2da11212f13c50..1117f47585b37e 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3416,7 +3416,7 @@ client cluster OperationalState = 96 { } /** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ -client cluster RoboticVacuumOperationalState = 97 { +client cluster RvcOperationalState = 97 { enum ErrorStateEnum : ENUM8 { kFailedToFindChargingDock = 64; kStuck = 65; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 238e6e3cd83233..9c13134213893e 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../app/zap-templates/zcl/zcl.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -13154,7 +13154,7 @@ ] }, { - "name": "Robotic Vacuum Operational State", + "name": "RVC Operational State", "code": 97, "mfgCode": null, "define": "OPERATIONAL_STATE_RVC_CLUSTER", @@ -13230,7 +13230,7 @@ ] }, { - "name": "Robotic Vacuum Operational State", + "name": "RVC Operational State", "code": 97, "mfgCode": null, "define": "OPERATIONAL_STATE_RVC_CLUSTER", diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 9b988ead4d2a73..aca7a3f14c1079 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -187,8 +187,8 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == OperationalState.ID) { return new OperationalState(); } - if (clusterId == RoboticVacuumOperationalState.ID) { - return new RoboticVacuumOperationalState(); + if (clusterId == RvcOperationalState.ID) { + return new RvcOperationalState(); } if (clusterId == HepaFilterMonitoring.ID) { return new HepaFilterMonitoring(); @@ -7709,7 +7709,7 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RoboticVacuumOperationalState implements BaseCluster { + public static class RvcOperationalState implements BaseCluster { public static final long ID = 97L; public long getID() { return ID; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 5b67e5c2e3247b..71d3eded1bdba3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -7420,117 +7420,117 @@ private static Map readOperationalStateInteractionInfo( return result; } - private static Map readRoboticVacuumOperationalStateInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRoboticVacuumOperationalStatePhaseListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( + private static Map readRvcOperationalStateInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcOperationalStatePhaseListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStatePhaseListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readPhaseListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readPhaseListAttribute( + (ChipClusters.RvcOperationalStateCluster.PhaseListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback(), - readRoboticVacuumOperationalStatePhaseListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterPhaseListAttributeCallback(), + readRvcOperationalStatePhaseListCommandParams ); - result.put("readPhaseListAttribute", readRoboticVacuumOperationalStatePhaseListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( + result.put("readPhaseListAttribute", readRvcOperationalStatePhaseListAttributeInteractionInfo); + Map readRvcOperationalStateCurrentPhaseCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateCurrentPhaseAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCurrentPhaseAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readCurrentPhaseAttribute( + (ChipClusters.RvcOperationalStateCluster.CurrentPhaseAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback(), - readRoboticVacuumOperationalStateCurrentPhaseCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterCurrentPhaseAttributeCallback(), + readRvcOperationalStateCurrentPhaseCommandParams ); - result.put("readCurrentPhaseAttribute", readRoboticVacuumOperationalStateCurrentPhaseAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentPhaseAttribute", readRvcOperationalStateCurrentPhaseAttributeInteractionInfo); + Map readRvcOperationalStateCountdownTimeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateCountdownTimeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readCountdownTimeAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readCountdownTimeAttribute( + (ChipClusters.RvcOperationalStateCluster.CountdownTimeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback(), - readRoboticVacuumOperationalStateCountdownTimeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterCountdownTimeAttributeCallback(), + readRvcOperationalStateCountdownTimeCommandParams ); - result.put("readCountdownTimeAttribute", readRoboticVacuumOperationalStateCountdownTimeAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( + result.put("readCountdownTimeAttribute", readRvcOperationalStateCountdownTimeAttributeInteractionInfo); + Map readRvcOperationalStateOperationalStateListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateOperationalStateListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readOperationalStateListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readOperationalStateListAttribute( + (ChipClusters.RvcOperationalStateCluster.OperationalStateListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback(), - readRoboticVacuumOperationalStateOperationalStateListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterOperationalStateListAttributeCallback(), + readRvcOperationalStateOperationalStateListCommandParams ); - result.put("readOperationalStateListAttribute", readRoboticVacuumOperationalStateOperationalStateListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOperationalStateListAttribute", readRvcOperationalStateOperationalStateListAttributeInteractionInfo); + Map readRvcOperationalStateGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcOperationalStateCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback(), - readRoboticVacuumOperationalStateGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterGeneratedCommandListAttributeCallback(), + readRvcOperationalStateGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRoboticVacuumOperationalStateGeneratedCommandListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRvcOperationalStateGeneratedCommandListAttributeInteractionInfo); + Map readRvcOperationalStateAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcOperationalStateCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback(), - readRoboticVacuumOperationalStateAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterAcceptedCommandListAttributeCallback(), + readRvcOperationalStateAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRoboticVacuumOperationalStateAcceptedCommandListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRvcOperationalStateAcceptedCommandListAttributeInteractionInfo); + Map readRvcOperationalStateEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readEventListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readEventListAttribute( + (ChipClusters.RvcOperationalStateCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback(), - readRoboticVacuumOperationalStateEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterEventListAttributeCallback(), + readRvcOperationalStateEventListCommandParams ); - result.put("readEventListAttribute", readRoboticVacuumOperationalStateEventListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRvcOperationalStateEventListAttributeInteractionInfo); + Map readRvcOperationalStateAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readAttributeListAttribute( - (ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcOperationalStateCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback(), - readRoboticVacuumOperationalStateAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcOperationalStateClusterAttributeListAttributeCallback(), + readRvcOperationalStateAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRoboticVacuumOperationalStateAttributeListAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRvcOperationalStateAttributeListAttributeInteractionInfo); + Map readRvcOperationalStateFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RvcOperationalStateCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRoboticVacuumOperationalStateFeatureMapCommandParams + readRvcOperationalStateFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRoboticVacuumOperationalStateFeatureMapAttributeInteractionInfo); - Map readRoboticVacuumOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRvcOperationalStateFeatureMapAttributeInteractionInfo); + Map readRvcOperationalStateClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcOperationalStateClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RvcOperationalStateCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRoboticVacuumOperationalStateClusterRevisionCommandParams + readRvcOperationalStateClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRoboticVacuumOperationalStateClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRvcOperationalStateClusterRevisionAttributeInteractionInfo); return result; } @@ -23336,7 +23336,7 @@ public Map> getReadAttributeMap() { put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); - put("roboticVacuumOperationalState", readRoboticVacuumOperationalStateInteractionInfo()); + put("rvcOperationalState", readRvcOperationalStateInteractionInfo()); put("hepaFilterMonitoring", readHepaFilterMonitoringInteractionInfo()); put("activatedCarbonFilterMonitoring", readActivatedCarbonFilterMonitoringInteractionInfo()); put("ceramicFilterMonitoring", readCeramicFilterMonitoringInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 659c5d0ee3dc1d..02f94db6e7a63d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1078,8 +1078,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("smokeCoAlarm", writeSmokeCoAlarmInteractionInfo); Map writeOperationalStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("operationalState", writeOperationalStateInteractionInfo); - Map writeRoboticVacuumOperationalStateInteractionInfo = new LinkedHashMap<>(); - writeAttributeMap.put("roboticVacuumOperationalState", writeRoboticVacuumOperationalStateInteractionInfo); + Map writeRvcOperationalStateInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("rvcOperationalState", writeRvcOperationalStateInteractionInfo); Map writeHepaFilterMonitoringInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("hepaFilterMonitoring", writeHepaFilterMonitoringInteractionInfo); Map writeActivatedCarbonFilterMonitoringInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 615c368c0707c8..638e49c7024a79 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -15291,8 +15291,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RoboticVacuumOperationalState::Id: { - using namespace app::Clusters::RoboticVacuumOperationalState; + case app::Clusters::RvcOperationalState::Id: { + using namespace app::Clusters::RvcOperationalState; switch (aPath.mAttributeId) { case Attributes::PhaseList::Id: { @@ -15405,20 +15405,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", operationalStateStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); return nullptr; } jmethodID operationalStateStructStructCtor_1 = env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { - ChipLogError( - Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); return nullptr; } @@ -15459,19 +15457,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jclass operationalStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", operationalStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); return nullptr; } jmethodID operationalStateStructStructCtor_0 = env->GetMethodID(operationalStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); return nullptr; } @@ -15521,18 +15518,17 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); return nullptr; } diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 0c5b959a478e20..e924882fb0d898 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -594,19 +594,19 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( +typedef void (*RvcOperationalStatePhaseListListAttributeCallback)( void * context, const chip::app::DataModel::Nullable> & data); -typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( +typedef void (*RvcOperationalStateOperationalStateListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); -typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RvcOperationalStateGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( +typedef void (*RvcOperationalStateAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( +typedef void (*RvcOperationalStateEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcOperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 79f848d427a08b..9bea5c009ec831 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -3043,8 +3043,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RoboticVacuumOperationalState::Id: { - using namespace app::Clusters::RoboticVacuumOperationalState; + case app::Clusters::RvcOperationalState::Id: { + using namespace app::Clusters::RvcOperationalState; switch (aPath.mEventId) { case Events::OperationalError::Id: { @@ -3090,18 +3090,17 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); return nullptr; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID( errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); return nullptr; } @@ -3111,21 +3110,19 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent", + env, "chip/devicecontroller/ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent", operationalErrorStructClass); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent"); + ChipLogError(Zcl, "Could not find class ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent"); return nullptr; } jmethodID operationalErrorStructCtor = env->GetMethodID(operationalErrorStructClass, "", - "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V"); + "(Lchip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct;)V"); if (operationalErrorStructCtor == nullptr) { - ChipLogError( - Zcl, "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationalErrorEvent constructor"); + ChipLogError(Zcl, "Could not find ChipEventStructs$RvcOperationalStateClusterOperationalErrorEvent constructor"); return nullptr; } @@ -3197,21 +3194,18 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jclass operationCompletionStructClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent", + env, "chip/devicecontroller/ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent", operationCompletionStructClass); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent"); + ChipLogError(Zcl, "Could not find class ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent"); return nullptr; } jmethodID operationCompletionStructCtor = env->GetMethodID( operationCompletionStructClass, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (operationCompletionStructCtor == nullptr) { - ChipLogError( - Zcl, - "Could not find ChipEventStructs$RoboticVacuumOperationalStateClusterOperationCompletionEvent constructor"); + ChipLogError(Zcl, "Could not find ChipEventStructs$RvcOperationalStateClusterOperationCompletionEvent constructor"); return nullptr; } diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 1b889b3567489d..be227349fbb7a8 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -3372,9 +3372,9 @@ void CHIPOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, CommandResponseState); } -CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: - CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CHIPRvcOperationalStateClusterOperationalCommandResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3390,8 +3390,8 @@ CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: } } -CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: - ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback() +CHIPRvcOperationalStateClusterOperationalCommandResponseCallback:: + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3402,9 +3402,9 @@ CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback:: env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( +void CHIPRvcOperationalStateClusterOperationalCommandResponseCallback::CallbackFn( void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3414,10 +3414,10 @@ void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback: VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3425,8 +3425,8 @@ void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback: VerifyOrReturn(javaCallbackRef != nullptr); err = JniReferences::GetInstance().FindMethod( - env, javaCallbackRef, "onSuccess", - "(Lchip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct;)V", &javaMethod); + env, javaCallbackRef, "onSuccess", "(Lchip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); jobject CommandResponseState; @@ -3465,18 +3465,17 @@ void CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback: jclass errorStateStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); return; } jmethodID errorStateStructStructCtor_0 = env->GetMethodID(errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V"); if (errorStateStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterErrorStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); return; } diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index c838d0e129b262..7e2685520d3a3c 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -571,17 +571,17 @@ class CHIPOperationalStateClusterOperationalCommandResponseCallback jobject javaCallbackRef; }; -class CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback - : public Callback::Callback +class CHIPRvcOperationalStateClusterOperationalCommandResponseCallback + : public Callback::Callback { public: - CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); + CHIPRvcOperationalStateClusterOperationalCommandResponseCallback(jobject javaCallback); - ~CHIPRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(); + ~CHIPRvcOperationalStateClusterOperationalCommandResponseCallback(); - static void CallbackFn( - void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); + static void + CallbackFn(void * context, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data); private: jobject javaCallbackRef; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index fcc2f44b7a1f5e..2c063769741b15 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -25454,9 +25454,9 @@ void CHIPOperationalStateAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStatePhaseListAttributeCallback::CHIPRvcOperationalStatePhaseListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25473,7 +25473,7 @@ CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CHIPRoboticVacuumOp } } -CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::~CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback() +CHIPRvcOperationalStatePhaseListAttributeCallback::~CHIPRvcOperationalStatePhaseListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25484,7 +25484,7 @@ CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::~CHIPRoboticVacuumO env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStatePhaseListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::Nullable> & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25494,8 +25494,8 @@ void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25529,9 +25529,9 @@ void CHIPRoboticVacuumOperationalStatePhaseListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateCurrentPhaseAttributeCallback::CHIPRvcOperationalStateCurrentPhaseAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25548,7 +25548,7 @@ CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CHIPRoboticVacuu } } -CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::~CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback() +CHIPRvcOperationalStateCurrentPhaseAttributeCallback::~CHIPRvcOperationalStateCurrentPhaseAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25559,8 +25559,8 @@ CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::~CHIPRoboticVacu env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPRvcOperationalStateCurrentPhaseAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25568,8 +25568,8 @@ void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25596,9 +25596,9 @@ void CHIPRoboticVacuumOperationalStateCurrentPhaseAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateCountdownTimeAttributeCallback::CHIPRvcOperationalStateCountdownTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25615,7 +25615,7 @@ CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CHIPRoboticVacu } } -CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::~CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback() +CHIPRvcOperationalStateCountdownTimeAttributeCallback::~CHIPRvcOperationalStateCountdownTimeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25626,8 +25626,8 @@ CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::~CHIPRoboticVac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPRvcOperationalStateCountdownTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25635,8 +25635,8 @@ void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25663,9 +25663,9 @@ void CHIPRoboticVacuumOperationalStateCountdownTimeAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: - CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateOperationalStateListAttributeCallback::CHIPRvcOperationalStateOperationalStateListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25682,8 +25682,7 @@ CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: } } -CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: - ~CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback() +CHIPRvcOperationalStateOperationalStateListAttributeCallback::~CHIPRvcOperationalStateOperationalStateListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25694,10 +25693,10 @@ CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateOperationalStateListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & list) + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25706,8 +25705,8 @@ void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::Cal VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25748,18 +25747,18 @@ void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::Cal jclass operationalStateStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct", + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", operationalStateStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); return; } jmethodID operationalStateStructStructCtor_1 = env->GetMethodID(operationalStateStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/util/Optional;)V"); if (operationalStateStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RoboticVacuumOperationalStateClusterOperationalStateStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); return; } @@ -25772,9 +25771,9 @@ void CHIPRoboticVacuumOperationalStateOperationalStateListAttributeCallback::Cal env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: - CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::CHIPRvcOperationalStateGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25791,8 +25790,7 @@ CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: } } -CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: - ~CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback() +CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::~CHIPRvcOperationalStateGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25803,7 +25801,7 @@ CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25813,8 +25811,8 @@ void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::Cal VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25844,9 +25842,9 @@ void CHIPRoboticVacuumOperationalStateGeneratedCommandListAttributeCallback::Cal env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: - CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::CHIPRvcOperationalStateAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25863,8 +25861,7 @@ CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: } } -CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: - ~CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback() +CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::~CHIPRvcOperationalStateAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25875,7 +25872,7 @@ CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -25885,8 +25882,8 @@ void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::Call VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25916,9 +25913,9 @@ void CHIPRoboticVacuumOperationalStateAcceptedCommandListAttributeCallback::Call env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CHIPRoboticVacuumOperationalStateEventListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateEventListAttributeCallback::CHIPRvcOperationalStateEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -25935,7 +25932,7 @@ CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CHIPRoboticVacuumOp } } -CHIPRoboticVacuumOperationalStateEventListAttributeCallback::~CHIPRoboticVacuumOperationalStateEventListAttributeCallback() +CHIPRvcOperationalStateEventListAttributeCallback::~CHIPRvcOperationalStateEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -25946,8 +25943,8 @@ CHIPRoboticVacuumOperationalStateEventListAttributeCallback::~CHIPRoboticVacuumO env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPRvcOperationalStateEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25956,8 +25953,8 @@ void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -25987,9 +25984,9 @@ void CHIPRoboticVacuumOperationalStateEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcOperationalStateAttributeListAttributeCallback::CHIPRvcOperationalStateAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -26006,7 +26003,7 @@ CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CHIPRoboticVacu } } -CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::~CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback() +CHIPRvcOperationalStateAttributeListAttributeCallback::~CHIPRvcOperationalStateAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -26017,7 +26014,7 @@ CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::~CHIPRoboticVac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CallbackFn( +void CHIPRvcOperationalStateAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -26027,8 +26024,8 @@ void CHIPRoboticVacuumOperationalStateAttributeListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index c47f7a1cdd6770..0dcded17ad2c69 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -16780,10 +16780,10 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RoboticVacuumOperationalStateCluster extends BaseChipCluster { + public static class RvcOperationalStateCluster extends BaseChipCluster { public static final long CLUSTER_ID = 97L; - public RoboticVacuumOperationalStateCluster(long devicePtr, int endpointId) { + public RvcOperationalStateCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @@ -16846,7 +16846,7 @@ private native void resume(long chipClusterPtr, OperationalCommandResponseCallba , @Nullable Integer timedInvokeTimeoutMs); public interface OperationalCommandResponseCallback { - void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct commandResponseState); + void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct commandResponseState); void onError(Exception error); } @@ -16868,7 +16868,7 @@ public interface CountdownTimeAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } public interface OperationalStateListAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index acbf63d6f4c4e2..81ef1fa558d09f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -1305,11 +1305,11 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterOperationalErrorEvent { -public ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState; +public static class RvcOperationalStateClusterOperationalErrorEvent { +public ChipStructs.RvcOperationalStateClusterErrorStateStruct errorState; - public RoboticVacuumOperationalStateClusterOperationalErrorEvent( - ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct errorState + public RvcOperationalStateClusterOperationalErrorEvent( + ChipStructs.RvcOperationalStateClusterErrorStateStruct errorState ) { this.errorState = errorState; } @@ -1317,7 +1317,7 @@ public RoboticVacuumOperationalStateClusterOperationalErrorEvent( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterOperationalErrorEvent {\n"); + output.append("RvcOperationalStateClusterOperationalErrorEvent {\n"); output.append("\terrorState: "); output.append(errorState); output.append("\n"); @@ -1326,12 +1326,12 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterOperationCompletionEvent { +public static class RvcOperationalStateClusterOperationCompletionEvent { public Integer completionErrorCode; public @Nullable Optional totalOperationalTime; public @Nullable Optional pausedTime; - public RoboticVacuumOperationalStateClusterOperationCompletionEvent( + public RvcOperationalStateClusterOperationCompletionEvent( Integer completionErrorCode , @Nullable Optional totalOperationalTime , @Nullable Optional pausedTime @@ -1344,7 +1344,7 @@ public RoboticVacuumOperationalStateClusterOperationCompletionEvent( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterOperationCompletionEvent {\n"); + output.append("RvcOperationalStateClusterOperationCompletionEvent {\n"); output.append("\tcompletionErrorCode: "); output.append(completionErrorCode); output.append("\n"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 1691df2f2bd8ee..c00922da385d68 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -184,7 +184,7 @@ public static String clusterIdToName(long clusterId) { return "OperationalState"; } if (clusterId == 97L) { - return "RoboticVacuumOperationalState"; + return "RvcOperationalState"; } if (clusterId == 113L) { return "HepaFilterMonitoring"; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index e7aff346222b4a..c6a21a366ae154 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1998,12 +1998,12 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterErrorStateStruct { +public static class RvcOperationalStateClusterErrorStateStruct { public Integer errorStateID; public Optional errorStateLabel; public Optional errorStateDetails; - public RoboticVacuumOperationalStateClusterErrorStateStruct( + public RvcOperationalStateClusterErrorStateStruct( Integer errorStateID , Optional errorStateLabel , Optional errorStateDetails @@ -2016,7 +2016,7 @@ public RoboticVacuumOperationalStateClusterErrorStateStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterErrorStateStruct {\n"); + output.append("RvcOperationalStateClusterErrorStateStruct {\n"); output.append("\terrorStateID: "); output.append(errorStateID); output.append("\n"); @@ -2031,11 +2031,11 @@ public String toString() { } } -public static class RoboticVacuumOperationalStateClusterOperationalStateStruct { +public static class RvcOperationalStateClusterOperationalStateStruct { public Integer operationalStateID; public Optional operationalStateLabel; - public RoboticVacuumOperationalStateClusterOperationalStateStruct( + public RvcOperationalStateClusterOperationalStateStruct( Integer operationalStateID , Optional operationalStateLabel ) { @@ -2046,7 +2046,7 @@ public RoboticVacuumOperationalStateClusterOperationalStateStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RoboticVacuumOperationalStateClusterOperationalStateStruct {\n"); + output.append("RvcOperationalStateClusterOperationalStateStruct {\n"); output.append("\toperationalStateID: "); output.append(operationalStateID); output.append("\n"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 71d7a62f7ecf6f..906e035ca7cdb4 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7332,7 +7332,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback implements ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7340,7 +7340,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.RoboticVacuumOperationalStateClusterErrorStateStruct CommandResponseState) { + public void onSuccess(ChipStructs.RvcOperationalStateClusterErrorStateStruct CommandResponseState) { Map responseValues = new LinkedHashMap<>(); // CommandResponseState: Struct ErrorStateStruct // Conversion from this type to Java is not properly implemented yet @@ -7353,7 +7353,7 @@ public void onError(Exception error) { } } - public static class DelegatedRoboticVacuumOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterPhaseListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.PhaseListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7372,7 +7372,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CurrentPhaseAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterCurrentPhaseAttributeCallback implements ChipClusters.RvcOperationalStateCluster.CurrentPhaseAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7391,7 +7391,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterCountdownTimeAttributeCallback implements ChipClusters.RvcOperationalStateCluster.CountdownTimeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7410,7 +7410,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.OperationalStateListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterOperationalStateListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.OperationalStateListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7418,9 +7418,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -7429,7 +7429,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7448,7 +7448,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7467,7 +7467,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterEventListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterEventListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7486,7 +7486,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRoboticVacuumOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RoboticVacuumOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcOperationalStateClusterAttributeListAttributeCallback implements ChipClusters.RvcOperationalStateCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20026,9 +20026,9 @@ public Map initializeClusterMap() { ClusterInfo operationalStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.OperationalStateCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("operationalState", operationalStateClusterInfo); - ClusterInfo roboticVacuumOperationalStateClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RoboticVacuumOperationalStateCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInfo); + ClusterInfo rvcOperationalStateClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RvcOperationalStateCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("rvcOperationalState", rvcOperationalStateClusterInfo); ClusterInfo hepaFilterMonitoringClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.HepaFilterMonitoringCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInfo); @@ -20320,7 +20320,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("smokeCoAlarm", smokeCoAlarmClusterInteractionInfoMap); Map operationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("operationalState", operationalStateClusterInteractionInfoMap); - Map roboticVacuumOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); - Map roboticVacuumOperationalStatepauseCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStatepauseInteractionInfo = new InteractionInfo( + Map rvcOperationalStateClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcOperationalStatepauseCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatepauseInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .pause((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .pause((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStatepauseCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatepauseCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("pause", roboticVacuumOperationalStatepauseInteractionInfo); - Map roboticVacuumOperationalStatestopCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStatestopInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("pause", rvcOperationalStatepauseInteractionInfo); + Map rvcOperationalStatestopCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatestopInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .stop((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .stop((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStatestopCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatestopCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("stop", roboticVacuumOperationalStatestopInteractionInfo); - Map roboticVacuumOperationalStatestartCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStatestartInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("stop", rvcOperationalStatestopInteractionInfo); + Map rvcOperationalStatestartCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStatestartInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .start((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .start((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStatestartCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStatestartCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("start", roboticVacuumOperationalStatestartInteractionInfo); - Map roboticVacuumOperationalStateresumeCommandParams = new LinkedHashMap(); - InteractionInfo roboticVacuumOperationalStateresumeInteractionInfo = new InteractionInfo( + rvcOperationalStateClusterInteractionInfoMap.put("start", rvcOperationalStatestartInteractionInfo); + Map rvcOperationalStateresumeCommandParams = new LinkedHashMap(); + InteractionInfo rvcOperationalStateresumeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RoboticVacuumOperationalStateCluster) cluster) - .resume((ChipClusters.RoboticVacuumOperationalStateCluster.OperationalCommandResponseCallback) callback + ((ChipClusters.RvcOperationalStateCluster) cluster) + .resume((ChipClusters.RvcOperationalStateCluster.OperationalCommandResponseCallback) callback ); }, - () -> new DelegatedRoboticVacuumOperationalStateClusterOperationalCommandResponseCallback(), - roboticVacuumOperationalStateresumeCommandParams + () -> new DelegatedRvcOperationalStateClusterOperationalCommandResponseCallback(), + rvcOperationalStateresumeCommandParams ); - roboticVacuumOperationalStateClusterInteractionInfoMap.put("resume", roboticVacuumOperationalStateresumeInteractionInfo); - commandMap.put("roboticVacuumOperationalState", roboticVacuumOperationalStateClusterInteractionInfoMap); + rvcOperationalStateClusterInteractionInfoMap.put("resume", rvcOperationalStateresumeInteractionInfo); + commandMap.put("rvcOperationalState", rvcOperationalStateClusterInteractionInfoMap); Map hepaFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("hepaFilterMonitoring", hepaFilterMonitoringClusterInteractionInfoMap); Map activatedCarbonFilterMonitoringClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 3a561178d48930..5bc1773b7ce3ce 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -5305,8 +5305,8 @@ class ChipClusters: }, }, } - _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO = { - "clusterName": "RoboticVacuumOperationalState", + _RVC_OPERATIONAL_STATE_CLUSTER_INFO = { + "clusterName": "RvcOperationalState", "clusterId": 0x00000061, "commands": { 0x00000000: { @@ -15695,7 +15695,7 @@ class ChipClusters: 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, - 0x00000061: _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO, + 0x00000061: _RVC_OPERATIONAL_STATE_CLUSTER_INFO, 0x00000071: _HEPA_FILTER_MONITORING_CLUSTER_INFO, 0x00000072: _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, 0x00000073: _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, @@ -15830,7 +15830,7 @@ class ChipClusters: "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, - "RoboticVacuumOperationalState": _ROBOTIC_VACUUM_OPERATIONAL_STATE_CLUSTER_INFO, + "RvcOperationalState": _RVC_OPERATIONAL_STATE_CLUSTER_INFO, "HepaFilterMonitoring": _HEPA_FILTER_MONITORING_CLUSTER_INFO, "ActivatedCarbonFilterMonitoring": _ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER_INFO, "CeramicFilterMonitoring": _CERAMIC_FILTER_MONITORING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2f9c0c0bc7ac56..d80b6b3b254ce5 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18564,7 +18564,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass -class RoboticVacuumOperationalState(Cluster): +class RvcOperationalState(Cluster): id: typing.ClassVar[int] = 0x0061 @ChipUtility.classproperty @@ -18574,9 +18574,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="phaseList", Tag=0x00000000, Type=typing.Union[Nullable, typing.List[str]]), ClusterObjectFieldDescriptor(Label="currentPhase", Tag=0x00000001, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="countdownTime", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="operationalStateList", Tag=0x00000003, Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]), - ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct), - ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="operationalStateList", Tag=0x00000003, Type=typing.List[RvcOperationalState.Structs.OperationalStateStruct]), + ClusterObjectFieldDescriptor(Label="operationalState", Tag=0x00000004, Type=RvcOperationalState.Structs.OperationalStateStruct), + ClusterObjectFieldDescriptor(Label="operationalError", Tag=0x00000005, Type=RvcOperationalState.Structs.ErrorStateStruct), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -18588,9 +18588,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: phaseList: 'typing.Union[Nullable, typing.List[str]]' = None currentPhase: 'typing.Union[Nullable, uint]' = None countdownTime: 'typing.Union[None, Nullable, uint]' = None - operationalStateList: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = None - operationalState: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = None - operationalError: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = None + operationalStateList: 'typing.List[RvcOperationalState.Structs.OperationalStateStruct]' = None + operationalState: 'RvcOperationalState.Structs.OperationalStateStruct' = None + operationalError: 'RvcOperationalState.Structs.ErrorStateStruct' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -18717,10 +18717,10 @@ class OperationalCommandResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="commandResponseState", Tag=0, Type=RvcOperationalState.Structs.ErrorStateStruct), ]) - commandResponseState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + commandResponseState: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) class Attributes: @dataclass @@ -18783,9 +18783,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RvcOperationalState.Structs.OperationalStateStruct]) - value: 'typing.List[RoboticVacuumOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RvcOperationalState.Structs.OperationalStateStruct]' = field(default_factory=lambda: []) @dataclass class OperationalState(ClusterAttributeDescriptor): @@ -18799,9 +18799,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.OperationalStateStruct) + return ClusterObjectFieldDescriptor(Type=RvcOperationalState.Structs.OperationalStateStruct) - value: 'RoboticVacuumOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.OperationalStateStruct()) + value: 'RvcOperationalState.Structs.OperationalStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.OperationalStateStruct()) @dataclass class OperationalError(ClusterAttributeDescriptor): @@ -18815,9 +18815,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct) + return ClusterObjectFieldDescriptor(Type=RvcOperationalState.Structs.ErrorStateStruct) - value: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + value: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @@ -18930,10 +18930,10 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RoboticVacuumOperationalState.Structs.ErrorStateStruct), + ClusterObjectFieldDescriptor(Label="errorState", Tag=0, Type=RvcOperationalState.Structs.ErrorStateStruct), ]) - errorState: 'RoboticVacuumOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RoboticVacuumOperationalState.Structs.ErrorStateStruct()) + errorState: 'RvcOperationalState.Structs.ErrorStateStruct' = field(default_factory=lambda: RvcOperationalState.Structs.ErrorStateStruct()) @dataclass class OperationCompletion(ClusterEvent): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index ca5f6de6d4d508..1b4bb1c6785da1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -2018,9 +2018,9 @@ static BOOL AttributeIsSpecifiedInOperationalStateCluster(AttributeId aAttribute } } } -static BOOL AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(AttributeId aAttributeId) +static BOOL AttributeIsSpecifiedInRVCOperationalStateCluster(AttributeId aAttributeId) { - using namespace Clusters::RoboticVacuumOperationalState; + using namespace Clusters::RvcOperationalState; switch (aAttributeId) { case Attributes::PhaseList::Id: { return YES; @@ -5145,8 +5145,8 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::OperationalState::Id: { return AttributeIsSpecifiedInOperationalStateCluster(aAttributeId); } - case Clusters::RoboticVacuumOperationalState::Id: { - return AttributeIsSpecifiedInRoboticVacuumOperationalStateCluster(aAttributeId); + case Clusters::RvcOperationalState::Id: { + return AttributeIsSpecifiedInRVCOperationalStateCluster(aAttributeId); } case Clusters::HepaFilterMonitoring::Id: { return AttributeIsSpecifiedInHEPAFilterMonitoringCluster(aAttributeId); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index a5635f62e1e325..e1d8de2a3f7709 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -10356,10 +10356,10 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( +static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::RoboticVacuumOperationalState; + using namespace Clusters::RvcOperationalState; switch (aAttributeId) { case Attributes::PhaseList::Id: { using TypeInfo = Attributes::PhaseList::TypeInfo; @@ -10439,8 +10439,8 @@ static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; if (entry_0.operationalStateLabel.HasValue()) { newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); @@ -10470,8 +10470,8 @@ static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( if (*aError != CHIP_NO_ERROR) { return nil; } - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull value; - value = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + MTRRVCOperationalStateClusterOperationalStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterOperationalStateStruct new]; value.operationalStateID = [NSNumber numberWithUnsignedChar:cppValue.operationalStateID]; if (cppValue.operationalStateLabel.HasValue()) { value.operationalStateLabel = AsString(cppValue.operationalStateLabel.Value()); @@ -10492,8 +10492,8 @@ static id _Nullable DecodeAttributeValueForRoboticVacuumOperationalStateCluster( if (*aError != CHIP_NO_ERROR) { return nil; } - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull value; - value = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterErrorStateStruct new]; value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; if (cppValue.errorStateLabel.HasValue()) { value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); @@ -24591,8 +24591,8 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::OperationalState::Id: { return DecodeAttributeValueForOperationalStateCluster(aPath.mAttributeId, aReader, aError); } - case Clusters::RoboticVacuumOperationalState::Id: { - return DecodeAttributeValueForRoboticVacuumOperationalStateCluster(aPath.mAttributeId, aReader, aError); + case Clusters::RvcOperationalState::Id: { + return DecodeAttributeValueForRVCOperationalStateCluster(aPath.mAttributeId, aReader, aError); } case Clusters::HepaFilterMonitoring::Id: { return DecodeAttributeValueForHEPAFilterMonitoringCluster(aPath.mAttributeId, aReader, aError); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 6a8ead093b0344..07d2e4bf1242bc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8737,12 +8737,12 @@ MTR_NEWLY_AVAILABLE @end /** - * Cluster Robotic Vacuum Operational State + * Cluster RVC Operational State * * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ MTR_NEWLY_AVAILABLE -@interface MTRBaseClusterRoboticVacuumOperationalState : MTRCluster +@interface MTRBaseClusterRVCOperationalState : MTRCluster - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID @@ -8753,20 +8753,20 @@ MTR_NEWLY_AVAILABLE * * Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)pauseWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** * Command Stop * * Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** * Command Start @@ -8774,10 +8774,10 @@ MTR_NEWLY_AVAILABLE * Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it * can be started. */ -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; /** * Command Resume @@ -8785,10 +8785,10 @@ MTR_NEWLY_AVAILABLE * Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the * point when it was paused by means outside of this cluster (for example by manual button press). */ -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -8839,38 +8839,31 @@ MTR_NEWLY_AVAILABLE completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeOperationalStateWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; +- (void)readAttributeOperationalStateWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler: - (void (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void) - readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; ++ (void)readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeOperationalErrorWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; +- (void)readAttributeOperationalErrorWithCompletion:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; + reportHandler:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; + (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion: - (void (^)( - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -24653,21 +24646,21 @@ typedef NS_ENUM(uint8_t, MTROperationalState) { MTROperationalStateError MTR_NEWLY_AVAILABLE = 0x03, } MTR_NEWLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateErrorState) { - MTRRoboticVacuumOperationalStateErrorStateFailedToFindChargingDock MTR_NEWLY_AVAILABLE = 0x40, - MTRRoboticVacuumOperationalStateErrorStateStuck MTR_NEWLY_AVAILABLE = 0x41, - MTRRoboticVacuumOperationalStateErrorStateDustBinMissing MTR_NEWLY_AVAILABLE = 0x42, - MTRRoboticVacuumOperationalStateErrorStateDustBinFull MTR_NEWLY_AVAILABLE = 0x43, - MTRRoboticVacuumOperationalStateErrorStateWaterTankEmpty MTR_NEWLY_AVAILABLE = 0x44, - MTRRoboticVacuumOperationalStateErrorStateWaterTankMissing MTR_NEWLY_AVAILABLE = 0x45, - MTRRoboticVacuumOperationalStateErrorStateWaterTankLidOpen MTR_NEWLY_AVAILABLE = 0x46, - MTRRoboticVacuumOperationalStateErrorStateMopCleaningPadMissing MTR_NEWLY_AVAILABLE = 0x47, +typedef NS_ENUM(uint8_t, MTRRVCOperationalStateErrorState) { + MTRRVCOperationalStateErrorStateFailedToFindChargingDock MTR_NEWLY_AVAILABLE = 0x40, + MTRRVCOperationalStateErrorStateStuck MTR_NEWLY_AVAILABLE = 0x41, + MTRRVCOperationalStateErrorStateDustBinMissing MTR_NEWLY_AVAILABLE = 0x42, + MTRRVCOperationalStateErrorStateDustBinFull MTR_NEWLY_AVAILABLE = 0x43, + MTRRVCOperationalStateErrorStateWaterTankEmpty MTR_NEWLY_AVAILABLE = 0x44, + MTRRVCOperationalStateErrorStateWaterTankMissing MTR_NEWLY_AVAILABLE = 0x45, + MTRRVCOperationalStateErrorStateWaterTankLidOpen MTR_NEWLY_AVAILABLE = 0x46, + MTRRVCOperationalStateErrorStateMopCleaningPadMissing MTR_NEWLY_AVAILABLE = 0x47, } MTR_NEWLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRRoboticVacuumOperationalStateOperationalState) { - MTRRoboticVacuumOperationalStateOperationalStateSeekingCharger MTR_NEWLY_AVAILABLE = 0x40, - MTRRoboticVacuumOperationalStateOperationalStateCharging MTR_NEWLY_AVAILABLE = 0x41, - MTRRoboticVacuumOperationalStateOperationalStateDocked MTR_NEWLY_AVAILABLE = 0x42, +typedef NS_ENUM(uint8_t, MTRRVCOperationalStateOperationalState) { + MTRRVCOperationalStateOperationalStateSeekingCharger MTR_NEWLY_AVAILABLE = 0x40, + MTRRVCOperationalStateOperationalStateCharging MTR_NEWLY_AVAILABLE = 0x41, + MTRRVCOperationalStateOperationalStateDocked MTR_NEWLY_AVAILABLE = 0x42, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringChangeIndication) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 087572b6978dba..eb201d04621037 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -50705,7 +50705,7 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end -@implementation MTRBaseClusterRoboticVacuumOperationalState +@implementation MTRBaseClusterRVCOperationalState - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue { @@ -50720,28 +50720,26 @@ - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)en return self; } -- (void)pauseWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)pauseWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self pauseWithParams:nil completion:completion]; } -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { // Make a copy of params before we go async. params = [params copy]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Pause::Type request; + RvcOperationalState::Commands::Pause::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50761,28 +50759,26 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N std::move(*bridge).DispatchAction(self.device); } -- (void)stopWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil completion:completion]; } -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { // Make a copy of params before we go async. params = [params copy]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Stop::Type request; + RvcOperationalState::Commands::Stop::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50802,28 +50798,26 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul std::move(*bridge).DispatchAction(self.device); } -- (void)startWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startWithParams:nil completion:completion]; } -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { // Make a copy of params before we go async. params = [params copy]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Start::Type request; + RvcOperationalState::Commands::Start::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50843,28 +50837,26 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N std::move(*bridge).DispatchAction(self.device); } -- (void)resumeWithCompletion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self resumeWithParams:nil completion:completion]; } -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { // Make a copy of params before we go async. params = [params copy]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, - completion, + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(self.callbackQueue, completion, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Resume::Type request; + RvcOperationalState::Commands::Resume::Type request; if (params != nil) { if (params.timedInvokeTimeoutMs != nil) { params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); @@ -50887,8 +50879,8 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * - (void)readAttributePhaseListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -50896,10 +50888,10 @@ - (void)subscribeAttributePhaseListWithParams:(MTRSubscribeParams * _Nonnull)par subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); } + (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer @@ -50907,12 +50899,12 @@ + (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContain queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStatePhaseListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::PhaseList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::PhaseList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -50930,7 +50922,7 @@ + (void)readAttributePhaseListWithClusterStateCache:(MTRClusterStateCacheContain - (void)readAttributeCurrentPhaseWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -50939,7 +50931,7 @@ - (void)subscribeAttributeCurrentPhaseWithParams:(MTRSubscribeParams * _Nonnull) subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -50955,7 +50947,7 @@ + (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheCont clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CurrentPhase::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CurrentPhase::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -50973,7 +50965,7 @@ + (void)readAttributeCurrentPhaseWithClusterStateCache:(MTRClusterStateCacheCont - (void)readAttributeCountdownTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -50982,7 +50974,7 @@ - (void)subscribeAttributeCountdownTimeWithParams:(MTRSubscribeParams * _Nonnull subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -50998,7 +50990,7 @@ + (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheCon clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::CountdownTime::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::CountdownTime::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51016,8 +51008,8 @@ + (void)readAttributeCountdownTimeWithClusterStateCache:(MTRClusterStateCacheCon - (void)readAttributeOperationalStateListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; - return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51027,8 +51019,8 @@ - (void)subscribeAttributeOperationalStateListWithParams:(MTRSubscribeParams * _ reportHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51039,12 +51031,12 @@ + (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateC completion: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateOperationalStateListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalStateList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::OperationalStateList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51059,44 +51051,41 @@ + (void)readAttributeOperationalStateListWithClusterStateCache:(MTRClusterStateC }); } -- (void)readAttributeOperationalStateWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeOperationalStateWithCompletion:(void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } - (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler: - (void (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } -+ (void) - readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, - NSError * _Nullable error))completion ++ (void)readAttributeOperationalStateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, + NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateOperationalStateStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalState::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::OperationalState::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51111,42 +51100,40 @@ - (void)subscribeAttributeOperationalStateWithParams:(MTRSubscribeParams * _Nonn }); } -- (void)readAttributeOperationalErrorWithCompletion: - (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeOperationalErrorWithCompletion:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } - (void)subscribeAttributeOperationalErrorWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, - NSError * _Nullable error))reportHandler + reportHandler:(void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, + NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, - reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, + self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } + (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion: - (void (^)( - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, + (void (^)(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateOperationalErrorStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::OperationalError::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::OperationalError::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51164,8 +51151,8 @@ + (void)readAttributeOperationalErrorWithClusterStateCache:(MTRClusterStateCache - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; - return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51175,8 +51162,8 @@ - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _ reportHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51187,12 +51174,12 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC completion: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::GeneratedCommandList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51210,9 +51197,8 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC - (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51221,8 +51207,8 @@ - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _N reportHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51233,12 +51219,12 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa completion: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::AcceptedCommandList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51256,8 +51242,8 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa - (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51265,10 +51251,10 @@ - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)par subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); } + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer @@ -51276,12 +51262,12 @@ + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContain queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateEventListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::EventList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::EventList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51299,9 +51285,8 @@ + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContain - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; - return MTRReadAttribute( + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51309,8 +51294,8 @@ - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51320,12 +51305,12 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); + auto * bridge = new MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(RoboticVacuumOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + ^(RVCOperationalStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::AttributeList::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::AttributeList::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51343,7 +51328,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51352,7 +51337,7 @@ - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)pa subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -51368,7 +51353,7 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::FeatureMap::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::FeatureMap::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -51386,7 +51371,7 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; return MTRReadAttribute( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -51395,7 +51380,7 @@ - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnu subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); @@ -51412,7 +51397,7 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = RoboticVacuumOperationalState::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = RvcOperationalState::Attributes::ClusterRevision::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index aa29354560fb44..d7135458fc7ec6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -225,7 +225,7 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end -@interface MTRBaseClusterRoboticVacuumOperationalState () +@interface MTRBaseClusterRVCOperationalState () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index df099251b0729e..74d4cfe31063c5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -87,8 +87,8 @@ typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); typedef void (*OperationalStateClusterOperationalCommandResponseCallbackType)( void *, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType &); -typedef void (*RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType)( - void *, const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &); +typedef void (*RVCOperationalStateClusterOperationalCommandResponseCallbackType)( + void *, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -416,14 +416,14 @@ typedef void (*OperationalStateClusterOperationalStateEnumAttributeCallback)( void *, chip::app::Clusters::OperationalState::OperationalStateEnum); typedef void (*NullableOperationalStateClusterOperationalStateEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*RoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( - void *, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum); -typedef void (*NullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*RoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( - void *, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum); -typedef void (*NullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); +typedef void (*RVCOperationalStateClusterErrorStateEnumAttributeCallback)(void *, + chip::app::Clusters::RvcOperationalState::ErrorStateEnum); +typedef void (*NullableRVCOperationalStateClusterErrorStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*RVCOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, chip::app::Clusters::RvcOperationalState::OperationalStateEnum); +typedef void (*NullableRVCOperationalStateClusterOperationalStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*HEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( void *, chip::app::Clusters::HepaFilterMonitoring::ChangeIndicationEnum); typedef void (*NullableHEPAFilterMonitoringClusterChangeIndicationEnumAttributeCallback)( @@ -1231,23 +1231,23 @@ typedef void (*OperationalStateEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*OperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStatePhaseListListAttributeCallback)( +typedef void (*RVCOperationalStatePhaseListListAttributeCallback)( void * context, const chip::app::DataModel::Nullable> & data); -typedef void (*RoboticVacuumOperationalStateOperationalStateListListAttributeCallback)( +typedef void (*RVCOperationalStateOperationalStateListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & data); -typedef void (*RoboticVacuumOperationalStateOperationalStateStructAttributeCallback)( - void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &); -typedef void (*RoboticVacuumOperationalStateOperationalErrorStructAttributeCallback)( - void *, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &); -typedef void (*RoboticVacuumOperationalStateGeneratedCommandListListAttributeCallback)( + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & data); +typedef void (*RVCOperationalStateOperationalStateStructAttributeCallback)( + void *, const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType &); +typedef void (*RVCOperationalStateOperationalErrorStructAttributeCallback)( + void *, const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType &); +typedef void (*RVCOperationalStateGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAcceptedCommandListListAttributeCallback)( +typedef void (*RVCOperationalStateAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateEventListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RoboticVacuumOperationalStateAttributeListListAttributeCallback)( +typedef void (*RVCOperationalStateEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RVCOperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); @@ -9619,281 +9619,270 @@ class MTROperationalStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStatePhaseListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; static void OnSuccessFn(void * context, const chip::app::DataModel::Nullable> & value); }; -class MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge +class MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStatePhaseListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStatePhaseListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & value); }; -class MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge +class MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value); + static void OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType & value); }; -class MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge +class MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value); + static void OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType & value); }; -class MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge +class MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge +class MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge +class MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateEventListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + MTRRVCOperationalStateEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge +class MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateEventListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRRVCOperationalStateEventListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateEventListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge +class MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateAttributeListListAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateAttributeListListAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; @@ -17072,23 +17061,20 @@ class MTROperationalStateClusterOperationalCommandResponseCallbackBridge const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; -class MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn( - void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data); + static void + OnSuccessFn(void * context, + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data); }; class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge @@ -22672,149 +22658,139 @@ class MTRNullableOperationalStateClusterOperationalStateEnumAttributeCallbackSub MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::RvcOperationalState::ErrorStateEnum value); }; -class MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +class MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge - : public MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge +class MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), + MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; + using MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void OnSuccessFn(void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::RvcOperationalState::OperationalStateEnum value); }; -class MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge - : public MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +class MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge { public: - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + using MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge - : public MTRCallbackBridge +class MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge + : public MTRCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler) : - MTRCallbackBridge(queue, handler, - OnSuccessFn){}; + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, - OnSuccessFn){}; + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(dispatch_queue_t queue, + ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, + OnSuccessFn){}; - static void OnSuccessFn( - void * context, - const chip::app::DataModel::Nullable & value); + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge - : public MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge +class MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge + : public MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge { public: - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, MTRSubscriptionEstablishedHandler establishedHandler) : - MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), + MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge(queue, handler, action), mEstablishedHandler(establishedHandler) {} void OnSubscriptionEstablished(); - using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; - using MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; + using MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::KeepAliveOnCallback; + using MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnDone; private: MTRSubscriptionEstablishedHandler mEstablishedHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 1293afafc039f6..11ef9066138495 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -9233,7 +9233,7 @@ } } -void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStatePhaseListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::Nullable> & value) { NSArray * _Nullable objCValue; @@ -9265,7 +9265,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStatePhaseListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9280,9 +9280,9 @@ } } -void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, +void MTRRVCOperationalStateOperationalStateListListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> & value) + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> & value) { NSArray * _Nonnull objCValue; { // Scope for our temporary variables @@ -9290,8 +9290,8 @@ auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; if (entry_0.operationalStateLabel.HasValue()) { newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); @@ -9315,7 +9315,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateOperationalStateListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9330,11 +9330,11 @@ } } -void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType & value) +void MTRRVCOperationalStateOperationalStateStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType & value) { - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; - objCValue = [MTRRoboticVacuumOperationalStateClusterOperationalStateStruct new]; + MTRRVCOperationalStateClusterOperationalStateStruct * _Nonnull objCValue; + objCValue = [MTRRVCOperationalStateClusterOperationalStateStruct new]; objCValue.operationalStateID = [NSNumber numberWithUnsignedChar:value.operationalStateID]; if (value.operationalStateLabel.HasValue()) { objCValue.operationalStateLabel = AsString(value.operationalStateLabel.Value()); @@ -9349,7 +9349,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateOperationalStateStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9364,11 +9364,11 @@ } } -void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType & value) +void MTRRVCOperationalStateOperationalErrorStructAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType & value) { - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull objCValue; - objCValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull objCValue; + objCValue = [MTRRVCOperationalStateClusterErrorStateStruct new]; objCValue.errorStateID = [NSNumber numberWithUnsignedChar:value.errorStateID]; if (value.errorStateLabel.HasValue()) { objCValue.errorStateLabel = AsString(value.errorStateLabel.Value()); @@ -9393,7 +9393,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateOperationalErrorStructAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9408,7 +9408,7 @@ } } -void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9431,7 +9431,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9446,7 +9446,7 @@ } } -void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9469,7 +9469,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9484,7 +9484,7 @@ } } -void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateEventListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9507,7 +9507,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -9522,7 +9522,7 @@ } } -void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( +void MTRRVCOperationalStateAttributeListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; @@ -9545,7 +9545,7 @@ DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -17744,10 +17744,10 @@ DispatchSuccess(context, response); }; -void MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn(void * context, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & data) +void MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & data) { - auto * response = [MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams new]; + auto * response = [MTRRVCOperationalStateClusterOperationalCommandResponseParams new]; CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; if (err != CHIP_NO_ERROR) { OnFailureFn(context, err); @@ -21827,15 +21827,15 @@ } } -void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::RoboticVacuumOperationalState::ErrorStateEnum value) +void MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RvcOperationalState::ErrorStateEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -21850,8 +21850,8 @@ } } -void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value) +void MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -21862,7 +21862,7 @@ DispatchSuccess(context, objCValue); }; -void MTRNullableRoboticVacuumOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRNullableRVCOperationalStateClusterErrorStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -21877,15 +21877,15 @@ } } -void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::RoboticVacuumOperationalState::OperationalStateEnum value) +void MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::RvcOperationalState::OperationalStateEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void MTRRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +void MTRRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; @@ -21900,8 +21900,8 @@ } } -void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value) +void MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -21912,8 +21912,7 @@ DispatchSuccess(context, objCValue); }; -void MTRNullableRoboticVacuumOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge:: - OnSubscriptionEstablished() +void MTRNullableRVCOperationalStateClusterOperationalStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() { if (!mQueue) { return; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index e92763b74e85bb..92f35f673db378 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -281,7 +281,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeSmokeCOAlarmID MTR_NEWLY_AVAILABLE = 0x0000005C, MTRClusterIDTypeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000060, - MTRClusterIDTypeRoboticVacuumOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000061, + MTRClusterIDTypeRVCOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000061, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, MTRClusterIDTypeActivatedCarbonFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000072, MTRClusterIDTypeDoorLockID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000101, @@ -3826,24 +3826,24 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, - // Cluster RoboticVacuumOperationalState attributes - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + // Cluster RVCOperationalState attributes + MTRAttributeIDTypeClusterRVCOperationalStateAttributePhaseListID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeCurrentPhaseID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeCountdownTimeID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateListID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterRVCOperationalStateAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeEventListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeAttributeListID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, - MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + MTRAttributeIDTypeClusterRVCOperationalStateAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, // Cluster HEPAFilterMonitoring attributes @@ -9297,12 +9297,12 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, MTRCommandIDTypeClusterOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, - // Cluster RoboticVacuumOperationalState commands - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, - MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, + // Cluster RVCOperationalState commands + MTRCommandIDTypeClusterRVCOperationalStateCommandPauseID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterRVCOperationalStateCommandStopID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterRVCOperationalStateCommandStartID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterRVCOperationalStateCommandResumeID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterRVCOperationalStateCommandOperationalCommandResponseID MTR_NEWLY_AVAILABLE = 0x00000004, // Cluster HEPAFilterMonitoring commands MTRCommandIDTypeClusterHEPAFilterMonitoringCommandResetConditionID MTR_NEWLY_AVAILABLE = 0x00000000, @@ -10453,9 +10453,9 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { MTREventIDTypeClusterOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, MTREventIDTypeClusterOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, - // Cluster RoboticVacuumOperationalState events - MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, - MTREventIDTypeClusterRoboticVacuumOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster RVCOperationalState events + MTREventIDTypeClusterRVCOperationalStateEventOperationalErrorID MTR_NEWLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterRVCOperationalStateEventOperationCompletionID MTR_NEWLY_AVAILABLE = 0x00000001, // Cluster DoorLock deprecated event names MTRClusterDoorLockEventDoorLockAlarmID MTR_DEPRECATED("Please use MTREventIDTypeClusterDoorLockEventDoorLockAlarmID", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 5357cdde89d6b1..7f62aa4280d55d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3057,51 +3057,51 @@ MTR_NEWLY_AVAILABLE @end /** - * Cluster Robotic Vacuum Operational State + * Cluster RVC Operational State * This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ MTR_NEWLY_AVAILABLE -@interface MTRClusterRoboticVacuumOperationalState : MTRCluster +@interface MTRClusterRVCOperationalState : MTRCluster - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)pauseWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)stopWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)startWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)resumeWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 006cc041f8adaa..99f1566cb1bc91 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13913,7 +13913,7 @@ - (void)resumeWithParams:(MTROperationalStateClusterResumeParams * _Nullable)par @end -@implementation MTRClusterRoboticVacuumOperationalState +@implementation MTRClusterRVCOperationalState - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue { @@ -13930,20 +13930,20 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpoi - (void)pauseWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self pauseWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _Nullable)params +- (void)pauseWithParams:(MTRRVCOperationalStateClusterPauseParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandPauseID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandPauseID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -13955,7 +13955,7 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -13965,14 +13965,13 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Pause::Type request; + RvcOperationalState::Commands::Pause::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14007,20 +14006,20 @@ - (void)pauseWithParams:(MTRRoboticVacuumOperationalStateClusterPauseParams * _N - (void)stopWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self stopWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nullable)params +- (void)stopWithParams:(MTRRVCOperationalStateClusterStopParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStopID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandStopID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -14032,7 +14031,7 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -14042,14 +14041,13 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Stop::Type request; + RvcOperationalState::Commands::Stop::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14084,20 +14082,20 @@ - (void)stopWithParams:(MTRRoboticVacuumOperationalStateClusterStopParams * _Nul - (void)startWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self startWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _Nullable)params +- (void)startWithParams:(MTRRVCOperationalStateClusterStartParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandStartID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandStartID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -14109,7 +14107,7 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -14119,14 +14117,13 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Start::Type request; + RvcOperationalState::Commands::Start::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14161,20 +14158,20 @@ - (void)startWithParams:(MTRRoboticVacuumOperationalStateClusterStartParams * _N - (void)resumeWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { [self resumeWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; } -- (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * _Nullable)params +- (void)resumeWithParams:(MTRRVCOperationalStateClusterResumeParams * _Nullable)params expectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable data, + completion:(void (^)(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable data, NSError * _Nullable error))completion { NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeRoboticVacuumOperationalStateID, - (unsigned int) MTRCommandIDTypeClusterRoboticVacuumOperationalStateCommandResumeID]; + _endpoint, (unsigned int) MTRClusterIDTypeRVCOperationalStateID, + (unsigned int) MTRCommandIDTypeClusterRVCOperationalStateCommandResumeID]; // Make a copy of params before we go async. params = [params copy]; NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; @@ -14186,7 +14183,7 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; - auto * bridge = new MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackBridge( + auto * bridge = new MTRRVCOperationalStateClusterOperationalCommandResponseCallbackBridge( self.device.queue, ^(id _Nullable value, NSError * _Nullable error) { MTRClustersLogCompletion(logPrefix, value, error); @@ -14196,14 +14193,13 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * [workItem endWork]; }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, - RoboticVacuumOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, + RVCOperationalStateClusterOperationalCommandResponseCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge - = static_cast(bridge); + auto * typedBridge = static_cast(bridge); Optional timedInvokeTimeoutMs; Optional invokeTimeout; ListFreer listFreer; - RoboticVacuumOperationalState::Commands::Resume::Type request; + RvcOperationalState::Commands::Resume::Type request; if (timedInvokeTimeoutMsParam != nil) { timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); } @@ -14239,105 +14235,97 @@ - (void)resumeWithParams:(MTRRoboticVacuumOperationalStateClusterResumeParams * - (NSDictionary *)readAttributePhaseListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributePhaseListID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributePhaseListID) params:params]; } - (NSDictionary *)readAttributeCurrentPhaseWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCurrentPhaseID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeCurrentPhaseID) params:params]; } - (NSDictionary *)readAttributeCountdownTimeWithParams:(MTRReadParams * _Nullable)params { - return - [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeCountdownTimeID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeCountdownTimeID) + params:params]; } - (NSDictionary *)readAttributeOperationalStateListWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateListID) + params:params]; } - (NSDictionary *)readAttributeOperationalStateWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalStateID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalStateID) + params:params]; } - (NSDictionary *)readAttributeOperationalErrorWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeOperationalErrorID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeOperationalErrorID) + params:params]; } - (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeGeneratedCommandListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeGeneratedCommandListID) + params:params]; } - (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params { - return [self.device - readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAcceptedCommandListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeAcceptedCommandListID) + params:params]; } - (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeEventListID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeEventListID) params:params]; } - (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params { - return - [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeAttributeListID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeAttributeListID) + params:params]; } - (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeFeatureMapID) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeFeatureMapID) params:params]; } - (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params { - return - [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeRoboticVacuumOperationalStateID) - attributeID:@(MTRAttributeIDTypeClusterRoboticVacuumOperationalStateAttributeClusterRevisionID) - params:params]; + return [self.device readAttributeWithEndpointID:@(_endpoint) + clusterID:@(MTRClusterIDTypeRVCOperationalStateID) + attributeID:@(MTRAttributeIDTypeClusterRVCOperationalStateAttributeClusterRevisionID) + params:params]; } @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 129f5bdc5ad9fc..849782b23cad83 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -226,7 +226,7 @@ @property (nonatomic, readonly) MTRDevice * device; @end -@interface MTRClusterRoboticVacuumOperationalState () +@interface MTRClusterRVCOperationalState () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 0cb9be344b6023..8838c0c06e0703 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4267,7 +4267,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterPauseParams : NSObject +@interface MTRRVCOperationalStateClusterPauseParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4295,7 +4295,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterStopParams : NSObject +@interface MTRRVCOperationalStateClusterStopParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4323,7 +4323,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterStartParams : NSObject +@interface MTRRVCOperationalStateClusterStartParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4351,7 +4351,7 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterResumeParams : NSObject +@interface MTRRVCOperationalStateClusterResumeParams : NSObject /** * Controls whether the command is a timed command (using Timed Invoke). * @@ -4379,13 +4379,12 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams : NSObject +@interface MTRRVCOperationalStateClusterOperationalCommandResponseParams : NSObject -@property (nonatomic, copy) - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull commandResponseState MTR_NEWLY_AVAILABLE; /** - * Initialize an MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams with a response-value dictionary + * Initialize an MTRRVCOperationalStateClusterOperationalCommandResponseParams with a response-value dictionary * of the sort that MTRDeviceResponseHandler would receive. * * Will return nil and hand out an error if the response-value dictionary is not diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index d1d8bfd771ed4c..7e03309d57cca3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6714,7 +6714,7 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct: return CHIP_NO_ERROR; } @end -@implementation MTRRoboticVacuumOperationalStateClusterPauseParams +@implementation MTRRVCOperationalStateClusterPauseParams - (instancetype)init { if (self = [super init]) { @@ -6726,7 +6726,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterPauseParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6741,7 +6741,7 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterStopParams +@implementation MTRRVCOperationalStateClusterStopParams - (instancetype)init { if (self = [super init]) { @@ -6753,7 +6753,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterStopParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6768,7 +6768,7 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterStartParams +@implementation MTRRVCOperationalStateClusterStartParams - (instancetype)init { if (self = [super init]) { @@ -6780,7 +6780,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterStartParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6795,7 +6795,7 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterResumeParams +@implementation MTRRVCOperationalStateClusterResumeParams - (instancetype)init { if (self = [super init]) { @@ -6807,7 +6807,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterResumeParams alloc] init]; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -6822,19 +6822,19 @@ - (NSString *)description } @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams +@implementation MTRRVCOperationalStateClusterOperationalCommandResponseParams - (instancetype)init { if (self = [super init]) { - _commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + _commandResponseState = [MTRRVCOperationalStateClusterErrorStateStruct new]; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationalCommandResponseParams alloc] init]; other.commandResponseState = self.commandResponseState; @@ -6855,7 +6855,7 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r return nil; } - using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using DecodableType = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue clusterID:DecodableType::GetClusterId() commandID:DecodableType::GetCommandId() @@ -6890,13 +6890,13 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) +@implementation MTRRVCOperationalStateClusterOperationalCommandResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: - (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct + (const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct { { - self.commandResponseState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + self.commandResponseState = [MTRRVCOperationalStateClusterErrorStateStruct new]; self.commandResponseState.errorStateID = [NSNumber numberWithUnsignedChar:decodableStruct.commandResponseState.errorStateID]; if (decodableStruct.commandResponseState.errorStateLabel.HasValue()) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index f7058c2accf769..51c8bc30950138 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -224,11 +224,10 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams (InternalMethods) +@interface MTRRVCOperationalStateClusterOperationalCommandResponseParams (InternalMethods) - (CHIP_ERROR)_setFieldsFromDecodableStruct: - (const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType &) - decodableStruct; + (const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType &)decodableStruct; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 28390e012b6421..193a8a34012329 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1848,10 +1848,9 @@ static id _Nullable DecodeEventPayloadForOperationalStateCluster(EventId aEventI *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } -static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( - EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeEventPayloadForRVCOperationalStateCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::RoboticVacuumOperationalState; + using namespace Clusters::RvcOperationalState; switch (aEventId) { case Events::OperationalError::Id: { Events::OperationalError::DecodableType cppValue; @@ -1860,11 +1859,11 @@ static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( return nil; } - __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent new]; + __auto_type * value = [MTRRVCOperationalStateClusterOperationalErrorEvent new]; do { - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull memberValue; - memberValue = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull memberValue; + memberValue = [MTRRVCOperationalStateClusterErrorStateStruct new]; memberValue.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorState.errorStateID]; if (cppValue.errorState.errorStateLabel.HasValue()) { memberValue.errorStateLabel = AsString(cppValue.errorState.errorStateLabel.Value()); @@ -1898,7 +1897,7 @@ static id _Nullable DecodeEventPayloadForRoboticVacuumOperationalStateCluster( return nil; } - __auto_type * value = [MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent new]; + __auto_type * value = [MTRRVCOperationalStateClusterOperationCompletionEvent new]; do { NSNumber * _Nonnull memberValue; @@ -3144,8 +3143,8 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::OperationalState::Id: { return DecodeEventPayloadForOperationalStateCluster(aPath.mEventId, aReader, aError); } - case Clusters::RoboticVacuumOperationalState::Id: { - return DecodeEventPayloadForRoboticVacuumOperationalStateCluster(aPath.mEventId, aReader, aError); + case Clusters::RvcOperationalState::Id: { + return DecodeEventPayloadForRVCOperationalStateCluster(aPath.mEventId, aReader, aError); } case Clusters::HepaFilterMonitoring::Id: { return DecodeEventPayloadForHEPAFilterMonitoringCluster(aPath.mEventId, aReader, aError); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index df9df1aa8f266f..e870b156e5c1a9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -784,25 +784,25 @@ MTR_NEWLY_AVAILABLE @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterErrorStateStruct : NSObject +@interface MTRRVCOperationalStateClusterErrorStateStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull errorStateID MTR_NEWLY_AVAILABLE; @property (nonatomic, copy) NSString * _Nullable errorStateLabel MTR_NEWLY_AVAILABLE; @property (nonatomic, copy) NSString * _Nullable errorStateDetails MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterOperationalStateStruct : NSObject +@interface MTRRVCOperationalStateClusterOperationalStateStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull operationalStateID MTR_NEWLY_AVAILABLE; @property (nonatomic, copy) NSString * _Nullable operationalStateLabel MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent : NSObject -@property (nonatomic, copy) MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; +@interface MTRRVCOperationalStateClusterOperationalErrorEvent : NSObject +@property (nonatomic, copy) MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull errorState MTR_NEWLY_AVAILABLE; @end MTR_NEWLY_AVAILABLE -@interface MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent : NSObject +@interface MTRRVCOperationalStateClusterOperationCompletionEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull completionErrorCode MTR_NEWLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable totalOperationalTime MTR_NEWLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable pausedTime MTR_NEWLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 49c260685ea8d8..39b94703e32f23 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3114,7 +3114,7 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterErrorStateStruct +@implementation MTRRVCOperationalStateClusterErrorStateStruct - (instancetype)init { if (self = [super init]) { @@ -3130,7 +3130,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterErrorStateStruct alloc] init]; + auto other = [[MTRRVCOperationalStateClusterErrorStateStruct alloc] init]; other.errorStateID = self.errorStateID; other.errorStateLabel = self.errorStateLabel; @@ -3148,7 +3148,7 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalStateStruct +@implementation MTRRVCOperationalStateClusterOperationalStateStruct - (instancetype)init { if (self = [super init]) { @@ -3162,7 +3162,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalStateStruct alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationalStateStruct alloc] init]; other.operationalStateID = self.operationalStateID; other.operationalStateLabel = self.operationalStateLabel; @@ -3179,19 +3179,19 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent +@implementation MTRRVCOperationalStateClusterOperationalErrorEvent - (instancetype)init { if (self = [super init]) { - _errorState = [MTRRoboticVacuumOperationalStateClusterErrorStateStruct new]; + _errorState = [MTRRVCOperationalStateClusterErrorStateStruct new]; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationalErrorEvent alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationalErrorEvent alloc] init]; other.errorState = self.errorState; @@ -3207,7 +3207,7 @@ - (NSString *)description @end -@implementation MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent +@implementation MTRRVCOperationalStateClusterOperationCompletionEvent - (instancetype)init { if (self = [super init]) { @@ -3223,7 +3223,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRRoboticVacuumOperationalStateClusterOperationCompletionEvent alloc] init]; + auto other = [[MTRRVCOperationalStateClusterOperationCompletionEvent alloc] init]; other.completionErrorCode = self.completionErrorCode; other.totalOperationalTime = self.totalOperationalTime; diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 25de60374eea9f..247201f74622f6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -9699,7 +9699,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Attributes { namespace CurrentPhase { @@ -9709,7 +9709,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -9731,7 +9731,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -9740,7 +9740,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -9762,7 +9762,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -9784,7 +9784,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -9793,7 +9793,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_ELAPSED_S_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -9815,7 +9815,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9834,7 +9834,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -9846,7 +9846,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -9865,13 +9865,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RoboticVacuumOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcOperationalState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index cb4e413dc21d55..07ea56af7ea851 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1812,7 +1812,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Attributes { namespace CurrentPhase { @@ -1840,7 +1840,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 6fbefcb1aca444..634371b70db90f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -457,13 +457,13 @@ void emberAfSmokeCoAlarmClusterInitCallback(chip::EndpointId endpoint); */ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Init +/** @brief RVC Operational State Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRoboticVacuumOperationalStateClusterInitCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpoint); /** @brief HEPA Filter Monitoring Cluster Init * @@ -5180,43 +5180,42 @@ void emberAfOperationalStateClusterServerTickCallback(chip::EndpointId endpoint) void emberAfOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); // -// Robotic Vacuum Operational State Cluster +// RVC Operational State Cluster // -/** @brief Robotic Vacuum Operational State Cluster Server Init +/** @brief RVC Operational State Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRoboticVacuumOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Server Shutdown +/** @brief RVC Operational State Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRoboticVacuumOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRvcOperationalStateClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Client Init +/** @brief RVC Operational State Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRoboticVacuumOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Server Attribute Changed +/** @brief RVC Operational State Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRoboticVacuumOperationalStateClusterServerAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath); +void MatterRvcOperationalStateClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief Robotic Vacuum Operational State Cluster Server Pre Attribute Changed +/** @brief RVC Operational State Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -5225,10 +5224,10 @@ void MatterRoboticVacuumOperationalStateClusterServerAttributeChangedCallback( * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterServerPreAttributeChangedCallback( +chip::Protocols::InteractionModel::Status MatterRvcOperationalStateClusterServerPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Robotic Vacuum Operational State Cluster Client Pre Attribute Changed +/** @brief RVC Operational State Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -5237,24 +5236,24 @@ chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClu * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRoboticVacuumOperationalStateClusterClientPreAttributeChangedCallback( +chip::Protocols::InteractionModel::Status MatterRvcOperationalStateClusterClientPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Robotic Vacuum Operational State Cluster Server Tick +/** @brief RVC Operational State Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRoboticVacuumOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Robotic Vacuum Operational State Cluster Client Tick +/** @brief RVC Operational State Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRoboticVacuumOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRvcOperationalStateClusterClientTickCallback(chip::EndpointId endpoint); // // HEPA Filter Monitoring Cluster @@ -11816,29 +11815,29 @@ bool emberAfOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalState::Commands::Resume::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Pause Command callback (from client) + * @brief RVC Operational State Cluster Pause Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterPauseCallback( +bool emberAfRvcOperationalStateClusterPauseCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Pause::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Stop Command callback (from client) + * @brief RVC Operational State Cluster Stop Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterStopCallback( +bool emberAfRvcOperationalStateClusterStopCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Stop::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Start Command callback (from client) + * @brief RVC Operational State Cluster Start Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterStartCallback( +bool emberAfRvcOperationalStateClusterStartCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Start::DecodableType & commandData); /** - * @brief Robotic Vacuum Operational State Cluster Resume Command callback (from client) + * @brief RVC Operational State Cluster Resume Command callback (from client) */ -bool emberAfRoboticVacuumOperationalStateClusterResumeCallback( +bool emberAfRvcOperationalStateClusterResumeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::DecodableType & commandData); + const chip::app::Clusters::RvcOperationalState::Commands::Resume::DecodableType & commandData); /** * @brief HEPA Filter Monitoring Cluster ResetCondition Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index df5387fba26364..c46fcf136fc3ac 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1500,9 +1500,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(OperationalState::Opera } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::ErrorStateEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcOperationalState::ErrorStateEnum val) { - using EnumType = RoboticVacuumOperationalState::ErrorStateEnum; + using EnumType = RvcOperationalState::ErrorStateEnum; switch (val) { case EnumType::kFailedToFindChargingDock: @@ -1518,9 +1518,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationa return static_cast(0); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RoboticVacuumOperationalState::OperationalStateEnum val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcOperationalState::OperationalStateEnum val) { - using EnumType = RoboticVacuumOperationalState::OperationalStateEnum; + using EnumType = RvcOperationalState::OperationalStateEnum; switch (val) { case EnumType::kSeekingCharger: diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 75ef76a7a7ba03..b2f8e557c3ac27 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1835,7 +1835,7 @@ enum class OperationalStateEnum : uint8_t }; } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { // Enum for ErrorStateEnum enum class ErrorStateEnum : uint8_t @@ -1867,7 +1867,7 @@ enum class OperationalStateEnum : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 0, }; -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index fdc1b4ebd4b475..90dec009d9c8e7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -13514,7 +13514,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Structs {} // namespace Structs namespace Commands { @@ -13823,7 +13823,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationCompletion. } // namespace Events -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Commands { @@ -28389,7 +28389,7 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::RoboticVacuumOperationalState::Id: { + case Clusters::RvcOperationalState::Id: { switch (aCommand) { default: diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 502e4e9063aaaa..f024462a19e51e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -17075,7 +17075,7 @@ struct DecodableType } // namespace OperationCompletion } // namespace Events } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Structs { namespace ErrorStateStruct = Clusters::detail::Structs::ErrorStateStruct; namespace OperationalStateStruct = Clusters::detail::Structs::OperationalStateStruct; @@ -17122,11 +17122,11 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -17135,7 +17135,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Pause::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -17150,11 +17150,11 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -17163,7 +17163,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -17178,11 +17178,11 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::Start::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -17191,7 +17191,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Start::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -17206,11 +17206,11 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType; + using ResponseType = Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -17219,7 +17219,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::Resume::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -17235,7 +17235,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } Structs::ErrorStateStruct::Type commandResponseState; @@ -17250,7 +17250,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::OperationalCommandResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } Structs::ErrorStateStruct::DecodableType commandResponseState; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -17267,7 +17267,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable>; using DecodableArgType = const chip::app::DataModel::Nullable> &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PhaseList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17279,7 +17279,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPhase::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17291,7 +17291,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CountdownTime::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17299,14 +17299,13 @@ struct TypeInfo namespace OperationalStateList { struct TypeInfo { - using Type = - chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType>; + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType>; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> &; + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalStateList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17314,12 +17313,11 @@ struct TypeInfo namespace OperationalState { struct TypeInfo { - using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::Type; - using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType; - using DecodableArgType = - const chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType &; + using Type = chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::Type; + using DecodableType = chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalState::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17327,11 +17325,11 @@ struct TypeInfo namespace OperationalError { struct TypeInfo { - using Type = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::Type; - using DecodableType = chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType; - using DecodableArgType = const chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType &; + using Type = chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::Type; + using DecodableType = chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType &; - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalError::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -17339,37 +17337,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } }; } // namespace ClusterRevision @@ -17377,7 +17375,7 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); @@ -17410,7 +17408,7 @@ struct Type public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationalError::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr bool kIsFabricScoped = false; Structs::ErrorStateStruct::Type errorState; @@ -17423,7 +17421,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationalError::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } Structs::ErrorStateStruct::DecodableType errorState; @@ -17445,7 +17443,7 @@ struct Type public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } static constexpr bool kIsFabricScoped = false; uint8_t completionErrorCode = static_cast(0); @@ -17460,7 +17458,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return Events::OperationCompletion::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RoboticVacuumOperationalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcOperationalState::Id; } uint8_t completionErrorCode = static_cast(0); Optional> totalOperationalTime; @@ -17470,7 +17468,7 @@ struct DecodableType }; } // namespace OperationCompletion } // namespace Events -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index acebe9520aa223..0e53f32c7b92c1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -3021,7 +3021,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Attributes { namespace PhaseList { @@ -3073,7 +3073,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index daa8633beadfa5..f40a66c5d8e94a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -184,9 +184,9 @@ static constexpr ClusterId Id = 0x0000005C; namespace OperationalState { static constexpr ClusterId Id = 0x00000060; } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { static constexpr ClusterId Id = 0x00000061; -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { static constexpr ClusterId Id = 0x00000071; } // namespace HepaFilterMonitoring diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index fc3462859b428d..6e1e48f4ed2307 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -785,7 +785,7 @@ static constexpr CommandId Id = 0x00000004; } // namespace Commands } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Commands { namespace Pause { @@ -809,7 +809,7 @@ static constexpr CommandId Id = 0x00000004; } // namespace OperationalCommandResponse } // namespace Commands -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace HepaFilterMonitoring { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 1265841a3eabfe..65d06ed3442de0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -341,7 +341,7 @@ static constexpr EventId Id = 0x00000001; } // namespace Events } // namespace OperationalState -namespace RoboticVacuumOperationalState { +namespace RvcOperationalState { namespace Events { namespace OperationalError { @@ -353,7 +353,7 @@ static constexpr EventId Id = 0x00000001; } // namespace OperationCompletion } // namespace Events -} // namespace RoboticVacuumOperationalState +} // namespace RvcOperationalState namespace DoorLock { namespace Events { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 1572384dcf7798..0cc18ac44b09e3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -364,8 +364,7 @@ #endif #if defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_STATE_RVC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER \ - { chip::app::Clusters::RoboticVacuumOperationalState::Id, "Robotic Vacuum Operational State" }, +#define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER { chip::app::Clusters::RvcOperationalState::Id, "RVC Operational State" }, #else #define CHIP_PRINTCLUSTER_OPERATIONAL_STATE_RVC_CLUSTER #endif diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 5f02b1ee77f828..d0c1be59f9f87f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -85,7 +85,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | -| RoboticVacuumOperationalState | 0x0061 | +| RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -4865,7 +4865,7 @@ class OperationalStateResume : public ClusterCommand }; /*----------------------------------------------------------------------------*\ -| Cluster RoboticVacuumOperationalState | 0x0061 | +| Cluster RvcOperationalState | 0x0061 | |------------------------------------------------------------------------------| | Commands: | | | * Pause | 0x00 | @@ -4895,10 +4895,10 @@ class OperationalStateResume : public ClusterCommand /* * Command Pause */ -class RoboticVacuumOperationalStatePause : public ClusterCommand +class RvcOperationalStatePause : public ClusterCommand { public: - RoboticVacuumOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) + RvcOperationalStatePause(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("pause", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4918,16 +4918,16 @@ class RoboticVacuumOperationalStatePause : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Pause::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Pause::Type mRequest; }; /* * Command Stop */ -class RoboticVacuumOperationalStateStop : public ClusterCommand +class RvcOperationalStateStop : public ClusterCommand { public: - RoboticVacuumOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) + RvcOperationalStateStop(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("stop", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4947,16 +4947,16 @@ class RoboticVacuumOperationalStateStop : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Stop::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Stop::Type mRequest; }; /* * Command Start */ -class RoboticVacuumOperationalStateStart : public ClusterCommand +class RvcOperationalStateStart : public ClusterCommand { public: - RoboticVacuumOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) + RvcOperationalStateStart(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("start", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -4976,16 +4976,16 @@ class RoboticVacuumOperationalStateStart : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Start::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Start::Type mRequest; }; /* * Command Resume */ -class RoboticVacuumOperationalStateResume : public ClusterCommand +class RvcOperationalStateResume : public ClusterCommand { public: - RoboticVacuumOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) + RvcOperationalStateResume(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("resume", credsIssuerConfig) { ClusterCommand::AddArguments(); } @@ -5005,7 +5005,7 @@ class RoboticVacuumOperationalStateResume : public ClusterCommand } private: - chip::app::Clusters::RoboticVacuumOperationalState::Commands::Resume::Type mRequest; + chip::app::Clusters::RvcOperationalState::Commands::Resume::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -15673,21 +15673,21 @@ void registerClusterOperationalState(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } -void registerClusterRoboticVacuumOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRvcOperationalState(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RoboticVacuumOperationalState; + using namespace chip::app::Clusters::RvcOperationalState; - const char * clusterName = "RoboticVacuumOperationalState"; + const char * clusterName = "RvcOperationalState"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -15712,14 +15712,13 @@ void registerClusterRoboticVacuumOperationalState(Commands & commands, Credentia make_unique>>(Id, "countdown-time", 0, UINT32_MAX, Attributes::CountdownTime::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( + make_unique>>( Id, "operational-state-list", Attributes::OperationalStateList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique< - WriteAttributeAsComplex>( + make_unique>( Id, "operational-state", Attributes::OperationalState::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>( + make_unique>( Id, "operational-error", Attributes::OperationalError::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, @@ -24679,7 +24678,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); - registerClusterRoboticVacuumOperationalState(commands, credsIssuerConfig); + registerClusterRvcOperationalState(commands, credsIssuerConfig); registerClusterHepaFilterMonitoring(commands, credsIssuerConfig); registerClusterActivatedCarbonFilterMonitoring(commands, credsIssuerConfig); registerClusterCeramicFilterMonitoring(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 596893dc438cf6..9f0e8d02e5e6d3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3713,7 +3713,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value) + const RvcOperationalState::Events::OperationalError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -3729,7 +3729,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value) + const RvcOperationalState::Events::OperationCompletion::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -4541,9 +4541,8 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("commandResponseState", indent + 1, value.commandResponseState)); @@ -8539,67 +8538,67 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RoboticVacuumOperationalState::Id: { + case RvcOperationalState::Id: { switch (path.mAttributeId) { - case RoboticVacuumOperationalState::Attributes::PhaseList::Id: { + case RvcOperationalState::Attributes::PhaseList::Id: { chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PhaseList", 1, value); } - case RoboticVacuumOperationalState::Attributes::CurrentPhase::Id: { + case RvcOperationalState::Attributes::CurrentPhase::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentPhase", 1, value); } - case RoboticVacuumOperationalState::Attributes::CountdownTime::Id: { + case RvcOperationalState::Attributes::CountdownTime::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CountdownTime", 1, value); } - case RoboticVacuumOperationalState::Attributes::OperationalStateList::Id: { + case RvcOperationalState::Attributes::OperationalStateList::Id: { chip::app::DataModel::DecodableList< - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType> + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalStateList", 1, value); } - case RoboticVacuumOperationalState::Attributes::OperationalState::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Structs::OperationalStateStruct::DecodableType value; + case RvcOperationalState::Attributes::OperationalState::Id: { + chip::app::Clusters::RvcOperationalState::Structs::OperationalStateStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalState", 1, value); } - case RoboticVacuumOperationalState::Attributes::OperationalError::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Structs::ErrorStateStruct::DecodableType value; + case RvcOperationalState::Attributes::OperationalError::Id: { + chip::app::Clusters::RvcOperationalState::Structs::ErrorStateStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalError", 1, value); } - case RoboticVacuumOperationalState::Attributes::GeneratedCommandList::Id: { + case RvcOperationalState::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RoboticVacuumOperationalState::Attributes::AcceptedCommandList::Id: { + case RvcOperationalState::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RoboticVacuumOperationalState::Attributes::EventList::Id: { + case RvcOperationalState::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RoboticVacuumOperationalState::Attributes::AttributeList::Id: { + case RvcOperationalState::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RoboticVacuumOperationalState::Attributes::FeatureMap::Id: { + case RvcOperationalState::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RoboticVacuumOperationalState::Attributes::ClusterRevision::Id: { + case RvcOperationalState::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16432,11 +16431,11 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case RoboticVacuumOperationalState::Id: { + case RvcOperationalState::Id: { switch (path.mCommandId) { - case RoboticVacuumOperationalState::Commands::OperationalCommandResponse::Id: { - RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType value; + case RvcOperationalState::Commands::OperationalCommandResponse::Id: { + RvcOperationalState::Commands::OperationalCommandResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalCommandResponse", 1, value); } @@ -17055,16 +17054,16 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } - case RoboticVacuumOperationalState::Id: { + case RvcOperationalState::Id: { switch (header.mPath.mEventId) { - case RoboticVacuumOperationalState::Events::OperationalError::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType value; + case RvcOperationalState::Events::OperationalError::Id: { + chip::app::Clusters::RvcOperationalState::Events::OperationalError::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationalError", 1, value); } - case RoboticVacuumOperationalState::Events::OperationCompletion::Id: { - chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType value; + case RvcOperationalState::Events::OperationCompletion::Id: { + chip::app::Clusters::RvcOperationalState::Events::OperationCompletion::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OperationCompletion", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index e7e743dfb77cdf..7a5927a2769179 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -330,12 +330,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationalError::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Events::OperationCompletion::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationalError::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::RoboticVacuumOperationalState::Events::OperationCompletion::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::RvcOperationalState::Events::OperationalError::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::RvcOperationalState::Events::OperationCompletion::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Events::DoorLockAlarm::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, @@ -480,7 +478,7 @@ LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RoboticVacuumOperationalState::Commands::OperationalCommandResponse::DecodableType & value); + const chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 7469d4fb62afec..7e1cd5da8ddfe3 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -88,7 +88,7 @@ | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | -| RoboticVacuumOperationalState | 0x0061 | +| RvcOperationalState | 0x0061 | | HepaFilterMonitoring | 0x0071 | | ActivatedCarbonFilterMonitoring | 0x0072 | | CeramicFilterMonitoring | 0x0073 | @@ -45034,7 +45034,7 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib }; /*----------------------------------------------------------------------------*\ -| Cluster RoboticVacuumOperationalState | 0x0061 | +| Cluster RvcOperationalState | 0x0061 | |------------------------------------------------------------------------------| | Commands: | | | * Pause | 0x00 | @@ -45064,9 +45064,9 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib /* * Command Pause */ -class RoboticVacuumOperationalStatePause : public ClusterCommand { +class RvcOperationalStatePause : public ClusterCommand { public: - RoboticVacuumOperationalStatePause() + RvcOperationalStatePause() : ClusterCommand("pause") { ClusterCommand::AddArguments(); @@ -45077,17 +45077,17 @@ class RoboticVacuumOperationalStatePause : public ClusterCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterPauseParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterPauseParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { [cluster pauseWithParams:params - completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45109,9 +45109,9 @@ class RoboticVacuumOperationalStatePause : public ClusterCommand { /* * Command Stop */ -class RoboticVacuumOperationalStateStop : public ClusterCommand { +class RvcOperationalStateStop : public ClusterCommand { public: - RoboticVacuumOperationalStateStop() + RvcOperationalStateStop() : ClusterCommand("stop") { ClusterCommand::AddArguments(); @@ -45122,17 +45122,17 @@ class RoboticVacuumOperationalStateStop : public ClusterCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStopParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterStopParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { [cluster stopWithParams:params - completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45154,9 +45154,9 @@ class RoboticVacuumOperationalStateStop : public ClusterCommand { /* * Command Start */ -class RoboticVacuumOperationalStateStart : public ClusterCommand { +class RvcOperationalStateStart : public ClusterCommand { public: - RoboticVacuumOperationalStateStart() + RvcOperationalStateStart() : ClusterCommand("start") { ClusterCommand::AddArguments(); @@ -45167,17 +45167,17 @@ class RoboticVacuumOperationalStateStart : public ClusterCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterStartParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterStartParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { [cluster startWithParams:params - completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45199,9 +45199,9 @@ class RoboticVacuumOperationalStateStart : public ClusterCommand { /* * Command Resume */ -class RoboticVacuumOperationalStateResume : public ClusterCommand { +class RvcOperationalStateResume : public ClusterCommand { public: - RoboticVacuumOperationalStateResume() + RvcOperationalStateResume() : ClusterCommand("resume") { ClusterCommand::AddArguments(); @@ -45212,17 +45212,17 @@ class RoboticVacuumOperationalStateResume : public ClusterCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000061) command (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRRoboticVacuumOperationalStateClusterResumeParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRRVCOperationalStateClusterResumeParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { [cluster resumeWithParams:params - completion:^(MTRRoboticVacuumOperationalStateClusterOperationalCommandResponseParams * _Nullable values, + completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); responsesNeeded--; @@ -45244,27 +45244,27 @@ class RoboticVacuumOperationalStateResume : public ClusterCommand { /* * Attribute PhaseList */ -class ReadRoboticVacuumOperationalStatePhaseList : public ReadAttribute { +class ReadRvcOperationalStatePhaseList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStatePhaseList() + ReadRvcOperationalStatePhaseList() : ReadAttribute("phase-list") { } - ~ReadRoboticVacuumOperationalStatePhaseList() {} + ~ReadRvcOperationalStatePhaseList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState PhaseList read Error", error); + LogNSError("RVCOperationalState PhaseList read Error", error); } SetCommandExitStatus(error); }]; @@ -45272,22 +45272,22 @@ class ReadRoboticVacuumOperationalStatePhaseList : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStatePhaseList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStatePhaseList() + SubscribeAttributeRvcOperationalStatePhaseList() : SubscribeAttribute("phase-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStatePhaseList() {} + ~SubscribeAttributeRvcOperationalStatePhaseList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000000) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45303,7 +45303,7 @@ class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public Subscrib mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.PhaseList response %@", [value description]); + NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45314,27 +45314,27 @@ class SubscribeAttributeRoboticVacuumOperationalStatePhaseList : public Subscrib /* * Attribute CurrentPhase */ -class ReadRoboticVacuumOperationalStateCurrentPhase : public ReadAttribute { +class ReadRvcOperationalStateCurrentPhase : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateCurrentPhase() + ReadRvcOperationalStateCurrentPhase() : ReadAttribute("current-phase") { } - ~ReadRoboticVacuumOperationalStateCurrentPhase() {} + ~ReadRvcOperationalStateCurrentPhase() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState CurrentPhase read Error", error); + LogNSError("RVCOperationalState CurrentPhase read Error", error); } SetCommandExitStatus(error); }]; @@ -45342,22 +45342,22 @@ class ReadRoboticVacuumOperationalStateCurrentPhase : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateCurrentPhase : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() + SubscribeAttributeRvcOperationalStateCurrentPhase() : SubscribeAttribute("current-phase") { } - ~SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase() {} + ~SubscribeAttributeRvcOperationalStateCurrentPhase() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000001) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45373,7 +45373,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public Subsc mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CurrentPhase response %@", [value description]); + NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45384,27 +45384,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateCurrentPhase : public Subsc /* * Attribute CountdownTime */ -class ReadRoboticVacuumOperationalStateCountdownTime : public ReadAttribute { +class ReadRvcOperationalStateCountdownTime : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateCountdownTime() + ReadRvcOperationalStateCountdownTime() : ReadAttribute("countdown-time") { } - ~ReadRoboticVacuumOperationalStateCountdownTime() {} + ~ReadRvcOperationalStateCountdownTime() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState CountdownTime read Error", error); + LogNSError("RVCOperationalState CountdownTime read Error", error); } SetCommandExitStatus(error); }]; @@ -45412,22 +45412,22 @@ class ReadRoboticVacuumOperationalStateCountdownTime : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateCountdownTime : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() + SubscribeAttributeRvcOperationalStateCountdownTime() : SubscribeAttribute("countdown-time") { } - ~SubscribeAttributeRoboticVacuumOperationalStateCountdownTime() {} + ~SubscribeAttributeRvcOperationalStateCountdownTime() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000002) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45443,7 +45443,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public Subs mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.CountdownTime response %@", [value description]); + NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45454,27 +45454,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateCountdownTime : public Subs /* * Attribute OperationalStateList */ -class ReadRoboticVacuumOperationalStateOperationalStateList : public ReadAttribute { +class ReadRvcOperationalStateOperationalStateList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateOperationalStateList() + ReadRvcOperationalStateOperationalStateList() : ReadAttribute("operational-state-list") { } - ~ReadRoboticVacuumOperationalStateOperationalStateList() {} + ~ReadRvcOperationalStateOperationalStateList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState OperationalStateList read Error", error); + LogNSError("RVCOperationalState OperationalStateList read Error", error); } SetCommandExitStatus(error); }]; @@ -45482,22 +45482,22 @@ class ReadRoboticVacuumOperationalStateOperationalStateList : public ReadAttribu } }; -class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateOperationalStateList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() + SubscribeAttributeRvcOperationalStateOperationalStateList() : SubscribeAttribute("operational-state-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList() {} + ~SubscribeAttributeRvcOperationalStateOperationalStateList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000003) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45513,7 +45513,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : publ mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalStateList response %@", [value description]); + NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45524,28 +45524,28 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalStateList : publ /* * Attribute OperationalState */ -class ReadRoboticVacuumOperationalStateOperationalState : public ReadAttribute { +class ReadRvcOperationalStateOperationalState : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateOperationalState() + ReadRvcOperationalStateOperationalState() : ReadAttribute("operational-state") { } - ~ReadRoboticVacuumOperationalStateOperationalState() {} + ~ReadRvcOperationalStateOperationalState() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeOperationalStateWithCompletion:^( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState OperationalState read Error", error); + LogNSError("RVCOperationalState OperationalState read Error", error); } SetCommandExitStatus(error); }]; @@ -45553,22 +45553,22 @@ class ReadRoboticVacuumOperationalStateOperationalState : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateOperationalState : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateOperationalState() + SubscribeAttributeRvcOperationalStateOperationalState() : SubscribeAttribute("operational-state") { } - ~SubscribeAttributeRoboticVacuumOperationalStateOperationalState() {} + ~SubscribeAttributeRvcOperationalStateOperationalState() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000004) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45583,9 +45583,8 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public S subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^( - MTRRoboticVacuumOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalState response %@", [value description]); + reportHandler:^(MTRRVCOperationalStateClusterOperationalStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45596,28 +45595,28 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalState : public S /* * Attribute OperationalError */ -class ReadRoboticVacuumOperationalStateOperationalError : public ReadAttribute { +class ReadRvcOperationalStateOperationalError : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateOperationalError() + ReadRvcOperationalStateOperationalError() : ReadAttribute("operational-error") { } - ~ReadRoboticVacuumOperationalStateOperationalError() {} + ~ReadRvcOperationalStateOperationalError() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeOperationalErrorWithCompletion:^( - MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState OperationalError read Error", error); + LogNSError("RVCOperationalState OperationalError read Error", error); } SetCommandExitStatus(error); }]; @@ -45625,22 +45624,22 @@ class ReadRoboticVacuumOperationalStateOperationalError : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateOperationalError : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateOperationalError() + SubscribeAttributeRvcOperationalStateOperationalError() : SubscribeAttribute("operational-error") { } - ~SubscribeAttributeRoboticVacuumOperationalStateOperationalError() {} + ~SubscribeAttributeRvcOperationalStateOperationalError() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x00000005) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45655,8 +45654,8 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public S subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(MTRRoboticVacuumOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.OperationalError response %@", [value description]); + reportHandler:^(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45667,27 +45666,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateOperationalError : public S /* * Attribute GeneratedCommandList */ -class ReadRoboticVacuumOperationalStateGeneratedCommandList : public ReadAttribute { +class ReadRvcOperationalStateGeneratedCommandList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateGeneratedCommandList() + ReadRvcOperationalStateGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadRoboticVacuumOperationalStateGeneratedCommandList() {} + ~ReadRvcOperationalStateGeneratedCommandList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState GeneratedCommandList read Error", error); + LogNSError("RVCOperationalState GeneratedCommandList read Error", error); } SetCommandExitStatus(error); }]; @@ -45695,22 +45694,22 @@ class ReadRoboticVacuumOperationalStateGeneratedCommandList : public ReadAttribu } }; -class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() + SubscribeAttributeRvcOperationalStateGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList() {} + ~SubscribeAttributeRvcOperationalStateGeneratedCommandList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45726,7 +45725,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : publ mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.GeneratedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45737,27 +45736,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateGeneratedCommandList : publ /* * Attribute AcceptedCommandList */ -class ReadRoboticVacuumOperationalStateAcceptedCommandList : public ReadAttribute { +class ReadRvcOperationalStateAcceptedCommandList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateAcceptedCommandList() + ReadRvcOperationalStateAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadRoboticVacuumOperationalStateAcceptedCommandList() {} + ~ReadRvcOperationalStateAcceptedCommandList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState AcceptedCommandList read Error", error); + LogNSError("RVCOperationalState AcceptedCommandList read Error", error); } SetCommandExitStatus(error); }]; @@ -45765,22 +45764,22 @@ class ReadRoboticVacuumOperationalStateAcceptedCommandList : public ReadAttribut } }; -class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() + SubscribeAttributeRvcOperationalStateAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList() {} + ~SubscribeAttributeRvcOperationalStateAcceptedCommandList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45796,7 +45795,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : publi mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AcceptedCommandList response %@", [value description]); + NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45807,27 +45806,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateAcceptedCommandList : publi /* * Attribute EventList */ -class ReadRoboticVacuumOperationalStateEventList : public ReadAttribute { +class ReadRvcOperationalStateEventList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateEventList() + ReadRvcOperationalStateEventList() : ReadAttribute("event-list") { } - ~ReadRoboticVacuumOperationalStateEventList() {} + ~ReadRvcOperationalStateEventList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + NSLog(@"RVCOperationalState.EventList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState EventList read Error", error); + LogNSError("RVCOperationalState EventList read Error", error); } SetCommandExitStatus(error); }]; @@ -45835,22 +45834,22 @@ class ReadRoboticVacuumOperationalStateEventList : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateEventList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateEventList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateEventList() + SubscribeAttributeRvcOperationalStateEventList() : SubscribeAttribute("event-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateEventList() {} + ~SubscribeAttributeRvcOperationalStateEventList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45866,7 +45865,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateEventList : public Subscrib mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.EventList response %@", [value description]); + NSLog(@"RVCOperationalState.EventList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45877,27 +45876,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateEventList : public Subscrib /* * Attribute AttributeList */ -class ReadRoboticVacuumOperationalStateAttributeList : public ReadAttribute { +class ReadRvcOperationalStateAttributeList : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateAttributeList() + ReadRvcOperationalStateAttributeList() : ReadAttribute("attribute-list") { } - ~ReadRoboticVacuumOperationalStateAttributeList() {} + ~ReadRvcOperationalStateAttributeList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState AttributeList read Error", error); + LogNSError("RVCOperationalState AttributeList read Error", error); } SetCommandExitStatus(error); }]; @@ -45905,22 +45904,22 @@ class ReadRoboticVacuumOperationalStateAttributeList : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateAttributeList : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateAttributeList() + SubscribeAttributeRvcOperationalStateAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeRoboticVacuumOperationalStateAttributeList() {} + ~SubscribeAttributeRvcOperationalStateAttributeList() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -45936,7 +45935,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public Subs mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.AttributeList response %@", [value description]); + NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); SetCommandExitStatus(error); }]; @@ -45947,27 +45946,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateAttributeList : public Subs /* * Attribute FeatureMap */ -class ReadRoboticVacuumOperationalStateFeatureMap : public ReadAttribute { +class ReadRvcOperationalStateFeatureMap : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateFeatureMap() + ReadRvcOperationalStateFeatureMap() : ReadAttribute("feature-map") { } - ~ReadRoboticVacuumOperationalStateFeatureMap() {} + ~ReadRvcOperationalStateFeatureMap() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState FeatureMap read Error", error); + LogNSError("RVCOperationalState FeatureMap read Error", error); } SetCommandExitStatus(error); }]; @@ -45975,22 +45974,22 @@ class ReadRoboticVacuumOperationalStateFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() + SubscribeAttributeRvcOperationalStateFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeRoboticVacuumOperationalStateFeatureMap() {} + ~SubscribeAttributeRvcOperationalStateFeatureMap() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -46006,7 +46005,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public Subscri mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.FeatureMap response %@", [value description]); + NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); SetCommandExitStatus(error); }]; @@ -46017,27 +46016,27 @@ class SubscribeAttributeRoboticVacuumOperationalStateFeatureMap : public Subscri /* * Attribute ClusterRevision */ -class ReadRoboticVacuumOperationalStateClusterRevision : public ReadAttribute { +class ReadRvcOperationalStateClusterRevision : public ReadAttribute { public: - ReadRoboticVacuumOperationalStateClusterRevision() + ReadRvcOperationalStateClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadRoboticVacuumOperationalStateClusterRevision() {} + ~ReadRvcOperationalStateClusterRevision() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); if (error != nil) { - LogNSError("RoboticVacuumOperationalState ClusterRevision read Error", error); + LogNSError("RVCOperationalState ClusterRevision read Error", error); } SetCommandExitStatus(error); }]; @@ -46045,22 +46044,22 @@ class ReadRoboticVacuumOperationalStateClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeRoboticVacuumOperationalStateClusterRevision : public SubscribeAttribute { +class SubscribeAttributeRvcOperationalStateClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() + SubscribeAttributeRvcOperationalStateClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeRoboticVacuumOperationalStateClusterRevision() {} + ~SubscribeAttributeRvcOperationalStateClusterRevision() {} CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000061) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterRoboticVacuumOperationalState alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCOperationalState alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -46076,7 +46075,7 @@ class SubscribeAttributeRoboticVacuumOperationalStateClusterRevision : public Su mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"RoboticVacuumOperationalState.ClusterRevision response %@", [value description]); + NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); SetCommandExitStatus(error); }]; @@ -123647,45 +123646,45 @@ void registerClusterOperationalState(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterRoboticVacuumOperationalState(Commands & commands) +void registerClusterRvcOperationalState(Commands & commands) { - using namespace chip::app::Clusters::RoboticVacuumOperationalState; + using namespace chip::app::Clusters::RvcOperationalState; - const char * clusterName = "RoboticVacuumOperationalState"; + const char * clusterName = "RvcOperationalState"; commands_list clusterCommands = { make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(Id), // - make_unique(), // + make_unique(), // make_unique(Id), // make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(Id), // make_unique(Id), // }; @@ -126398,7 +126397,7 @@ void registerClusters(Commands & commands) registerClusterAirQuality(commands); registerClusterSmokeCoAlarm(commands); registerClusterOperationalState(commands); - registerClusterRoboticVacuumOperationalState(commands); + registerClusterRvcOperationalState(commands); registerClusterHepaFilterMonitoring(commands); registerClusterActivatedCarbonFilterMonitoring(commands); registerClusterDoorLock(commands); From 764fe547890902fe0cebafeeebb2493953841b28 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Fri, 16 Jun 2023 22:13:30 +0800 Subject: [PATCH 26/31] ESP32: Do not read the ap record if esp_wifi_scan_start() is not called by NetworkCommissioningDriver (#27161) --- .../ESP32/NetworkCommissioningDriver.cpp | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/platform/ESP32/NetworkCommissioningDriver.cpp b/src/platform/ESP32/NetworkCommissioningDriver.cpp index 148704eeeeef2a..7e080f5246256e 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.cpp +++ b/src/platform/ESP32/NetworkCommissioningDriver.cpp @@ -297,27 +297,26 @@ CHIP_ERROR ESPWiFiDriver::StartScanWiFiNetworks(ByteSpan ssid) void ESPWiFiDriver::OnScanWiFiNetworkDone() { + if (!mpScanCallback) + { + ChipLogProgress(DeviceLayer, "No scan callback"); + return; + } uint16_t ap_number; esp_wifi_scan_get_ap_num(&ap_number); if (!ap_number) { ChipLogProgress(DeviceLayer, "No AP found"); - if (mpScanCallback != nullptr) - { - mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), nullptr); - mpScanCallback = nullptr; - } + mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), nullptr); + mpScanCallback = nullptr; return; } std::unique_ptr ap_buffer_ptr(new wifi_ap_record_t[ap_number]); if (ap_buffer_ptr == NULL) { ChipLogError(DeviceLayer, "can't malloc memory for ap_list_buffer"); - if (mpScanCallback) - { - mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); - mpScanCallback = nullptr; - } + mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + mpScanCallback = nullptr; return; } wifi_ap_record_t * ap_list_buffer = ap_buffer_ptr.get(); @@ -339,16 +338,19 @@ void ESPWiFiDriver::OnScanWiFiNetworkDone() { ap_buffer_ptr.release(); } - } - else - { - ChipLogError(DeviceLayer, "can't get ap_records "); - if (mpScanCallback) + else { + ChipLogError(DeviceLayer, "can't schedule the scan result processing"); mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); mpScanCallback = nullptr; } } + else + { + ChipLogError(DeviceLayer, "can't get ap_records "); + mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + mpScanCallback = nullptr; + } } void ESPWiFiDriver::OnNetworkStatusChange() From 8be97d882d2e513166261ddff7ee2e78d28284f1 Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Fri, 16 Jun 2023 19:43:50 +0530 Subject: [PATCH 27/31] [Silabs][SiWx917] Led 1 enabled for 917 soc (#27146) * led 1 fix enabled for 917 soc * adding conditional based check for BRD4325B --- examples/lighting-app/silabs/src/AppTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp index 43fa014f9aa866..af6bbdf8af38ea 100644 --- a/examples/lighting-app/silabs/src/AppTask.cpp +++ b/examples/lighting-app/silabs/src/AppTask.cpp @@ -40,7 +40,7 @@ #include -#if defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) +#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(BRD4325B)) #define LIGHT_LED 1 #else #define LIGHT_LED 0 From 5ed31da5cc5086fcfe0c3271c046ecbc87c30970 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 16 Jun 2023 10:49:03 -0400 Subject: [PATCH 28/31] Remove tracing of encrypted message data (prepared buffers). (#27276) * Remove tracing of encrypted message data (prepared buffers). We had data logging for prepared messages that were still in encrypted format. This data does not seem useful: shows hex content of encrypted data and generally we would have unencrypted send/receive tracing instead. Remove it for now to simplify code. * Restyled by clang-format --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- examples/common/tracing/TraceHandlers.cpp | 50 +---------------------- src/transport/SessionManager.cpp | 3 -- src/transport/TraceMessage.h | 39 ++---------------- 3 files changed, 4 insertions(+), 88 deletions(-) diff --git a/examples/common/tracing/TraceHandlers.cpp b/examples/common/tracing/TraceHandlers.cpp index ea40e285df3844..373b00cb61982c 100644 --- a/examples/common/tracing/TraceHandlers.cpp +++ b/examples/common/tracing/TraceHandlers.cpp @@ -226,22 +226,6 @@ std::string PayloadHeaderToJson(const PayloadHeader * payloadHeader) return jsonBody; } -std::string PreparedSecureMessageDataToJson(const TracePreparedSecureMessageData * data, const std::string & peerAddressKey) -{ - const System::PacketBuffer * packetBuffer = data->packetBuffer->operator->(); - std::string jsonBody = "{"; - jsonBody += AsFirstJsonKey(peerAddressKey, AsJsonString(data->peerAddress)); - jsonBody += ", "; - jsonBody += AsFirstJsonKey("payload_size", std::to_string(packetBuffer->DataLength())); - jsonBody += ", "; - jsonBody += AsFirstJsonKey("payload_hex", AsJsonHexString(packetBuffer->Start(), packetBuffer->DataLength())); - jsonBody += ", "; - jsonBody += AsFirstJsonKey("buffer_ptr", std::to_string(reinterpret_cast(packetBuffer))); - jsonBody += "}"; - - return jsonBody; -} - void SecureMessageSentHandler(const TraceSecureMessageSentData * eventData) { if (!gTraceOutputs.HasStreamAvailable()) @@ -290,41 +274,9 @@ void SecureMessageReceivedHandler(const TraceSecureMessageReceivedData * eventDa // Note that `eventData->session` is currently ignored. } -void PreparedMessageSentHandler(const TracePreparedSecureMessageData * eventData) -{ - if (!gTraceOutputs.HasStreamAvailable()) - { - return; - } - - gTraceOutputs.StartEvent(std::string{ kTraceMessageEvent } + "." + kTracePreparedMessageSentDataFormat); - gTraceOutputs.AddField("json", PreparedSecureMessageDataToJson(eventData, "destination")); - gTraceOutputs.FinishEvent(); -} - -void PreparedMessageReceivedHandler(const TracePreparedSecureMessageData * eventData) -{ - if (!gTraceOutputs.HasStreamAvailable()) - { - return; - } - - gTraceOutputs.StartEvent(std::string{ kTraceMessageEvent } + "." + kTracePreparedMessageReceivedDataFormat); - gTraceOutputs.AddField("json", PreparedSecureMessageDataToJson(eventData, "source")); - gTraceOutputs.FinishEvent(); -} - void TraceHandler(const char * type, const void * data, size_t size) { - if ((std::string{ type } == kTracePreparedMessageReceivedDataFormat) && (size == sizeof(TracePreparedSecureMessageData))) - { - PreparedMessageReceivedHandler(reinterpret_cast(data)); - } - else if ((std::string{ type } == kTracePreparedMessageSentDataFormat) && (size == sizeof(TracePreparedSecureMessageData))) - { - PreparedMessageSentHandler(reinterpret_cast(data)); - } - else if ((std::string{ type } == kTraceMessageSentDataFormat) && (size == sizeof(TraceSecureMessageSentData))) + if ((std::string{ type } == kTraceMessageSentDataFormat) && (size == sizeof(TraceSecureMessageSentData))) { SecureMessageSentHandler(reinterpret_cast(data)); } diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index e3c424fee20dc0..1aba11a75764db 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -389,7 +389,6 @@ CHIP_ERROR SessionManager::SendPreparedMessage(const SessionHandle & sessionHand destination = &(multicastAddress.SetInterface(interfaceId)); if (mTransportMgr != nullptr) { - CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, &tempBuf); if (CHIP_NO_ERROR != mTransportMgr->SendMessage(*destination, std::move(tempBuf))) { ChipLogError(Inet, "Failed to send Multicast message on interface %s", name); @@ -418,7 +417,6 @@ CHIP_ERROR SessionManager::SendPreparedMessage(const SessionHandle & sessionHand if (mTransportMgr != nullptr) { - CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, &msgBuf); return mTransportMgr->SendMessage(*destination, std::move(msgBuf)); } @@ -543,7 +541,6 @@ CHIP_ERROR SessionManager::InjectCaseSessionWithTestKey(SessionHolder & sessionH void SessionManager::OnMessageReceived(const PeerAddress & peerAddress, System::PacketBufferHandle && msg) { - CHIP_TRACE_PREPARED_MESSAGE_RECEIVED(&peerAddress, &msg); PacketHeader partialPacketHeader; CHIP_ERROR err = partialPacketHeader.DecodeFixed(msg); diff --git a/src/transport/TraceMessage.h b/src/transport/TraceMessage.h index f7d23697296091..b8c5f87f7c8c1a 100644 --- a/src/transport/TraceMessage.h +++ b/src/transport/TraceMessage.h @@ -57,22 +57,6 @@ sizeof(_trace_data)); \ } while (0) -#define CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, packetBuffer) \ - do \ - { \ - const ::chip::trace::TracePreparedSecureMessageData _trace_data{ destination, packetBuffer }; \ - _CHIP_TRACE_MESSAGE_INTERNAL(::chip::trace::kTracePreparedMessageSentDataFormat, \ - reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ - } while (0) - -#define CHIP_TRACE_PREPARED_MESSAGE_RECEIVED(source, packetBuffer) \ - do \ - { \ - const ::chip::trace::TracePreparedSecureMessageData _trace_data{ source, packetBuffer }; \ - _CHIP_TRACE_MESSAGE_INTERNAL(::chip::trace::kTracePreparedMessageReceivedDataFormat, \ - reinterpret_cast(&_trace_data), sizeof(_trace_data)); \ - } while (0) - #else // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED || CHIP_CONFIG_TRANSPORT_PW_TRACE_ENABLED #define CHIP_TRACE_MESSAGE_SENT(payloadHeader, packetHeader, data, dataLen) \ do \ @@ -84,25 +68,14 @@ { \ } while (0) -#define CHIP_TRACE_PREPARED_MESSAGE_SENT(destination, packetBuffer) \ - do \ - { \ - } while (0) - -#define CHIP_TRACE_PREPARED_MESSAGE_RECEIVED(source, packetBuffer) \ - do \ - { \ - } while (0) #endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED || CHIP_CONFIG_TRANSPORT_PW_TRACE_ENABLED namespace chip { namespace trace { -constexpr const char * kTraceMessageEvent = "SecureMsg"; -constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; -constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; -constexpr const char * kTracePreparedMessageSentDataFormat = "PreparedMsgSent"; -constexpr const char * kTracePreparedMessageReceivedDataFormat = "PreparedMsgReceived"; +constexpr const char * kTraceMessageEvent = "SecureMsg"; +constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; +constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; struct TraceSecureMessageSentData { @@ -122,12 +95,6 @@ struct TraceSecureMessageReceivedData size_t packetSize; }; -struct TracePreparedSecureMessageData -{ - const Transport::PeerAddress * peerAddress; - const System::PacketBufferHandle * packetBuffer; -}; - #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED typedef void (*TransportTraceHandler)(const char * type, const void * data, size_t size); From 470dd12761678a96ce5b9b63be2feec33ccf0ef8 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 16 Jun 2023 16:26:15 +0100 Subject: [PATCH 29/31] Update mode select xml following spec pr 7151 (#27249) * Renamed mode-select-cluster.xml to mode-base-cluster.xml and updated the contets to match the spec from PR 7151 * Renamed and updated the mode aliases to match the spec PR 7151. Updated the relevant lists. * Added the ModeSelect cluster xml from v1.1 * Updated the mode select aliase names in the cotroller BUILD.gn * Added the ModeSelect cluster and mode aliases to the contoller-clusters.zap * Generated the zap code. * Fixed typo in Mode Select * Regenerated code. * Reverted the mode select parts of the example source code to v1.1. * Update src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml Co-authored-by: Boris Zbarsky * Fixed typo. * Removed the use of the detail namespace for structs as it is failing tests. * Regenerated code. * Reverted the mode select test to v1.1. * Restyled by prettier-yaml * Regenerated code. * Authored by Boris Zbarsky: reverts fixes made when semantic tags where remaned to mode tags. * Regenerated code after merge. * Removed the description attribete from the mode base and all its aliased clusters. * Regenerated code after removing the description attribute. * Added a comment to explain why we have ModeBase enums commentd out. * Regenerated code after merge. * Removed duplicate entries in the data_modle/build.gn file caused by the merge. --------- Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io --- .github/workflows/tests.yaml | 11 +- .../all-clusters-app.matter | 28 +- .../src/static-supported-modes-manager.cpp | 23 +- .../all-clusters-minimal-app.matter | 28 +- .../bridge-common/bridge-app.matter | 1 - ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 1 - ...de_colortemperaturelight_hbUnzYVeyn.matter | 1 - .../rootnode_contactsensor_lFAGG1bfRO.matter | 1 - .../rootnode_dimmablelight_bCwGYSDpoe.matter | 1 - .../rootnode_doorlock_aNKYAreMXE.matter | 1 - ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 1 - .../devices/rootnode_fan_7N2TobIlOX.matter | 1 - .../rootnode_flowsensor_1zVxHedlaV.matter | 1 - ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 1 - .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 1 - .../rootnode_lightsensor_lZQycTFcJK.matter | 1 - ...rootnode_occupancysensor_iHyVgifZuo.matter | 1 - .../rootnode_onofflight_bbs1b7IaOV.matter | 1 - ...ootnode_onofflightswitch_FsPlMr090Q.matter | 1 - ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 1 - .../rootnode_pressuresensor_s0qC9wLH4k.matter | 1 - .../devices/rootnode_pump_a811bb33a0.matter | 1 - .../rootnode_speaker_RpzeXdimqA.matter | 1 - ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 1 - .../rootnode_thermostat_bm3fb8dhYi.matter | 1 - .../rootnode_windowcovering_RLCxaGi9Yx.matter | 1 - .../contact-sensor-app.matter | 1 - .../light-switch-app.matter | 1 - .../data_model/lighting-app-thread.matter | 1 - .../data_model/lighting-app-wifi.matter | 1 - .../lighting-common/lighting-app.matter | 1 - .../nxp/zap/lighting-on-off.matter | 1 - examples/lighting-app/qpg/zap/light.matter | 1 - .../data_model/lighting-thread-app.matter | 1 - .../data_model/lighting-wifi-app.matter | 1 - examples/lock-app/lock-common/lock-app.matter | 1 - examples/lock-app/nxp/zap/lock-app.matter | 1 - examples/lock-app/qpg/zap/lock.matter | 1 - .../log-source-common/log-source-app.matter | 1 - .../ota-provider-app.matter | 1 - .../ota-requestor-app.matter | 1 - .../placeholder/linux/apps/app1/config.matter | 73 +- .../placeholder/linux/apps/app2/config.matter | 73 +- .../linux/static-supported-modes-manager.cpp | 23 +- .../static-supported-modes-manager.cpp | 45 +- .../static-supported-modes-manager.h | 2 +- examples/pump-app/pump-common/pump-app.matter | 1 - .../pump-controller-app.matter | 1 - .../smoke-co-alarm-app.matter | 1 - .../temperature-measurement.matter | 1 - .../thermostat-common/thermostat.matter | 1 - examples/tv-app/tv-common/tv-app.matter | 1 - .../tv-casting-common/tv-casting-app.matter | 1 - examples/window-app/common/window-app.matter | 1 - scripts/rules.matterlint | 11 +- .../tests/suites/TestModeSelectCluster.yaml | 20 +- src/app/zap-templates/zcl/data-model/all.xml | 11 +- .../chip/dishwasher-mode-cluster.xml | 59 ++ .../chip/dishwasher-mode-select-cluster.xml | 71 -- .../chip/laundry-washer-mode-cluster.xml | 60 ++ .../laundry-washer-mode-select-cluster.xml | 72 -- .../zcl/data-model/chip/mode-base-cluster.xml | 106 +++ .../data-model/chip/mode-select-cluster.xml | 91 +- ...rature-controlled-cabinet-mode-cluster.xml | 58 ++ ...controlled-cabinet-mode-select-cluster.xml | 70 -- .../chip/rvc-clean-mode-cluster.xml | 64 ++ .../chip/rvc-clean-mode-select-cluster.xml | 76 -- .../data-model/chip/rvc-run-mode-cluster.xml | 70 ++ .../chip/rvc-run-mode-select-cluster.xml | 81 -- .../zcl/zcl-with-test-extensions.json | 11 +- src/app/zap-templates/zcl/zcl.json | 11 +- src/app/zap_cluster_list.json | 20 +- src/controller/data_model/BUILD.gn | 20 +- .../data_model/controller-clusters.matter | 195 ++--- .../data_model/controller-clusters.zap | 252 +++--- .../devicecontroller/ClusterIDMapping.java | 195 +---- .../devicecontroller/ClusterReadMapping.java | 715 ++++++++-------- .../devicecontroller/ClusterWriteMapping.java | 180 ++-- .../CHIPAttributeTLVValueDecoder.cpp | 322 ++----- .../java/zap-generated/CHIPClientCallbacks.h | 77 +- .../zap-generated/CHIPClustersWrite-JNI.cpp | 80 +- .../CHIPEventTLVValueDecoder.cpp | 20 +- .../zap-generated/CHIPInvokeCallbacks.cpp | 175 ++-- .../java/zap-generated/CHIPInvokeCallbacks.h | 71 +- .../java/zap-generated/CHIPReadCallbacks.cpp | 796 ++++++++---------- .../chip/devicecontroller/ChipClusters.java | 245 +----- .../chip/devicecontroller/ChipIdLookup.java | 55 +- .../chip/devicecontroller/ChipStructs.java | 136 ++- .../devicecontroller/ClusterInfoMapping.java | 375 +++------ .../python/chip/clusters/CHIPClusters.py | 182 ++-- .../python/chip/clusters/Objects.py | 418 ++------- .../Framework/CHIP/MTRBackwardsCompatShims.h | 5 - .../Framework/CHIP/MTRBackwardsCompatShims.mm | 3 - .../CHIP/templates/availability.yaml | 54 +- .../MTRAttributeTLVValueDecoder.mm | 14 +- .../CHIP/zap-generated/MTRBaseClusters.h | 7 +- .../CHIP/zap-generated/MTRCallbackBridge.mm | 14 +- .../CHIP/zap-generated/MTRStructsObjc.h | 16 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 26 +- src/platform/ESP32/ESP32Config.h | 6 +- .../zap-generated/attributes/Accessors.cpp | 317 ++----- .../zap-generated/attributes/Accessors.h | 45 +- .../app-common/zap-generated/callback.h | 279 +++--- .../zap-generated/cluster-enums-check.h | 62 +- .../app-common/zap-generated/cluster-enums.h | 71 +- .../zap-generated/cluster-objects.cpp | 297 ++----- .../zap-generated/cluster-objects.h | 587 ++++--------- .../app-common/zap-generated/ids/Attributes.h | 80 +- .../app-common/zap-generated/ids/Clusters.h | 20 +- .../app-common/zap-generated/ids/Commands.h | 58 +- .../app-common/zap-generated/print-cluster.h | 50 +- .../zap-generated/cluster/Commands.h | 391 ++------- .../cluster/ComplexArgumentParser.cpp | 76 +- .../cluster/ComplexArgumentParser.h | 10 + .../cluster/logging/DataModelLogger.cpp | 276 +++--- .../cluster/logging/DataModelLogger.h | 20 +- .../chip-tool/zap-generated/test/Commands.h | 218 ++--- .../zap-generated/cluster/Commands.h | 11 +- .../zap-generated/test/Commands.h | 234 ++--- 119 files changed, 3267 insertions(+), 5802 deletions(-) create mode 100644 src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml create mode 100644 src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4004b39e13af68..75a29d165a3eba 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -140,7 +140,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml \ @@ -155,12 +155,13 @@ jobs: src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml \ @@ -176,11 +177,11 @@ jobs: src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/refrigerator-alarm.xml \ src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml \ - src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/scene.xml \ src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml \ 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 1fd288a34aabd8..a28f341209feea 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 @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2315,40 +2314,19 @@ server cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp b/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp index a806a22c2757e2..17fa5d007b8493 100644 --- a/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp @@ -8,30 +8,31 @@ using namespace chip::app::Clusters::ModeSelect; using chip::Protocols::InteractionModel::Status; using ModeOptionStructType = Structs::ModeOptionStruct::Type; -using ModeTagType = Structs::ModeTagStruct::Type; +using SemanticTag = Structs::SemanticTagStruct::Type; template using List = app::DataModel::List; using storage_value_type = const ModeOptionStructType; namespace { -Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, const List & modeTags) +Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, + const List & semanticTags) { Structs::ModeOptionStruct::Type option; - option.label = CharSpan::fromCharString(label); - option.mode = mode; - option.modeTags = modeTags; + option.label = CharSpan::fromCharString(label); + option.mode = mode; + option.semanticTags = semanticTags; return option; } } // namespace -ModeTagType modeTagsBlack[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsCappucino[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsEspresso[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; +constexpr SemanticTag semanticTagsBlack[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsCappucino[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsEspresso[] = { { .value = 0 } }; // TODO: Configure your options for each endpoint storage_value_type StaticSupportedModesManager::coffeeOptions[] = { - buildModeOptionStruct("Black", 0, List(modeTagsBlack)), - buildModeOptionStruct("Cappuccino", 4, List(modeTagsCappucino)), - buildModeOptionStruct("Espresso", 7, List(modeTagsEspresso)) + buildModeOptionStruct("Black", 0, List(semanticTagsBlack)), + buildModeOptionStruct("Cappuccino", 4, List(semanticTagsCappucino)), + buildModeOptionStruct("Espresso", 7, List(semanticTagsEspresso)) }; const StaticSupportedModesManager::EndpointSpanPair StaticSupportedModesManager::supportedOptionsByEndpoints[EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT] = { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 104fa4b1dac252..38e86b0cb5f2cc 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2048,40 +2047,19 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 92cadc203dee65..599392b9eb050a 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 50a92f95409d58..4fe62d78026e38 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 54efa018e7cfa0..e20b2a20749066 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index bb701a18ee67f0..a1cdce02596163 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index c2e5318a739ab1..44262827d12e56 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 44034fc276cd9a..8857e1811d611f 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index b3287ac4d76f5d..08fcbd0cf16e3a 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 7ce96d6a1b79cc..eb3add96d7e94f 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index cf1217be0a4a81..3ad3bc94e5290f 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 293c6f20d54f28..8fdba87ff344ac 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index c92b8e34fd8d89..abb002c4dbbad2 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index a4ce7b2f50b217..d541e513c8588d 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 2419ff7c662a6b..949a75f397e194 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 58b80e234217b1..56dd6a89aade6b 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 75810385dd8bee..c44972ad3f5a9d 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 116c9888f85784..864754f15aa41f 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 156127529e8d0b..33c92330fceb89 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 96c4e8ccf06ba9..eb515a6d1308a3 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index f9b2b1a0bf7fed..8e5bf49c509652 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 3271ad89c92a0f..0b82d5134ab9c2 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 694dc771797ce9..9c544afea2f3d7 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index c2eea25c88feb7..c5b23ad6e2492a 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index a7a951c52a0ac2..a243adc44fb2cf 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 054967c1f9ec29..394f1f21915591 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 96ad29d946455b..eaf5d7f4a51eee 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index abea6c297c8826..618449050a7437 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 4a6f7909a556d7..533dba220fb674 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 0ae348837f0df0..3e04d5c0db617f 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 644724d1b7021c..d234be6ae3cfc3 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index c53787eaf6418e..c872fe09b891f8 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 65ec6c1f964fd6..0855b1e51f8bc2 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index bbe991722a17f7..904b86f5dbc8d9 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index e006c0ff6baf09..b9a1e853428a3d 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 77dade82d35019..ec736f3b188f9d 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index f982536f029c5c..cb248c52aac7d5 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 1048f1f23d986f..15deee36e5294c 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 624a7909f336f4..0d342e9d0d83a8 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index ced41db421494b..ff894c4b436aac 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2657,44 +2656,23 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; - readonly attribute optional nullable enum16 standardNamespace = 1; + readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; readonly attribute int8u currentMode = 3; attribute optional nullable int8u startUpMode = 4; @@ -2710,60 +2688,25 @@ client cluster ModeSelect = 80 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { - ENUM8 status = 0; - optional CHAR_STRING statusText = 1; - } - - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ + /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; } /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 486524fe426c1b..8380ee4e47e109 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2616,44 +2615,23 @@ server cluster BooleanState = 69 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; - readonly attribute optional nullable enum16 standardNamespace = 1; + readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; readonly attribute int8u currentMode = 3; attribute optional nullable int8u startUpMode = 4; @@ -2669,60 +2647,25 @@ client cluster ModeSelect = 80 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { - ENUM8 status = 0; - optional CHAR_STRING statusText = 1; - } - - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ + /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; } /** Attributes and commands for selecting a mode from a list of supported options. */ server cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; diff --git a/examples/placeholder/linux/static-supported-modes-manager.cpp b/examples/placeholder/linux/static-supported-modes-manager.cpp index a806a22c2757e2..17fa5d007b8493 100644 --- a/examples/placeholder/linux/static-supported-modes-manager.cpp +++ b/examples/placeholder/linux/static-supported-modes-manager.cpp @@ -8,30 +8,31 @@ using namespace chip::app::Clusters::ModeSelect; using chip::Protocols::InteractionModel::Status; using ModeOptionStructType = Structs::ModeOptionStruct::Type; -using ModeTagType = Structs::ModeTagStruct::Type; +using SemanticTag = Structs::SemanticTagStruct::Type; template using List = app::DataModel::List; using storage_value_type = const ModeOptionStructType; namespace { -Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, const List & modeTags) +Structs::ModeOptionStruct::Type buildModeOptionStruct(const char * label, uint8_t mode, + const List & semanticTags) { Structs::ModeOptionStruct::Type option; - option.label = CharSpan::fromCharString(label); - option.mode = mode; - option.modeTags = modeTags; + option.label = CharSpan::fromCharString(label); + option.mode = mode; + option.semanticTags = semanticTags; return option; } } // namespace -ModeTagType modeTagsBlack[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsCappucino[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; -ModeTagType modeTagsEspresso[] = { detail::Structs::ModeTagStruct::Type{ .value = 0 } }; +constexpr SemanticTag semanticTagsBlack[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsCappucino[] = { { .value = 0 } }; +constexpr SemanticTag semanticTagsEspresso[] = { { .value = 0 } }; // TODO: Configure your options for each endpoint storage_value_type StaticSupportedModesManager::coffeeOptions[] = { - buildModeOptionStruct("Black", 0, List(modeTagsBlack)), - buildModeOptionStruct("Cappuccino", 4, List(modeTagsCappucino)), - buildModeOptionStruct("Espresso", 7, List(modeTagsEspresso)) + buildModeOptionStruct("Black", 0, List(semanticTagsBlack)), + buildModeOptionStruct("Cappuccino", 4, List(semanticTagsCappucino)), + buildModeOptionStruct("Espresso", 7, List(semanticTagsEspresso)) }; const StaticSupportedModesManager::EndpointSpanPair StaticSupportedModesManager::supportedOptionsByEndpoints[EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT] = { diff --git a/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp b/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp index c5b744b3616dde..ed85f1068661f8 100644 --- a/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp +++ b/examples/platform/esp32/mode-support/static-supported-modes-manager.cpp @@ -26,7 +26,7 @@ using namespace chip::app::Clusters::ModeSelect; using chip::Protocols::InteractionModel::Status; using ModeOptionStructType = Structs::ModeOptionStruct::Type; -using ModeTagType = Structs::ModeTagStruct::Type; +using SemanticTag = Structs::SemanticTagStruct::Type; template using List = app::DataModel::List; @@ -51,7 +51,7 @@ SupportedModesManager::ModeOptionsProvider StaticSupportedModesManager::getModeO } ModeOptionStructType * modeOptionStructList = nullptr; - ModeTagType * modeTags = nullptr; + SemanticTag * semanticTags = nullptr; char keyBuf[ESP32Config::kMaxConfigKeyNameLength]; uint32_t supportedModeCount = 0; @@ -74,7 +74,7 @@ SupportedModesManager::ModeOptionsProvider StaticSupportedModesManager::getModeO { Structs::ModeOptionStruct::Type option; uint32_t supportedModeMode = 0; - uint32_t modeTagCount = 0; + uint32_t semanticTagCount = 0; size_t outLen = 0; memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); @@ -104,49 +104,50 @@ SupportedModesManager::ModeOptionsProvider StaticSupportedModesManager::getModeO ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); - VerifyOrReturnValue(ESP32Config::KeyAllocator::ModeTagsCount(keyBuf, sizeof(keyBuf), endpointId, index) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::KeyAllocator::SemanticTagsCount(keyBuf, sizeof(keyBuf), endpointId, index) == + CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); ESP32Config::Key stCountKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); - VerifyOrReturnValue(ESP32Config::ReadConfigValue(stCountKey, modeTagCount) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::ReadConfigValue(stCountKey, semanticTagCount) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); - modeTags = new ModeTagType[modeTagCount]; - if (modeTags == nullptr) + semanticTags = new SemanticTag[semanticTagCount]; + if (semanticTags == nullptr) { CleanUp(endpointId); return ModeOptionsProvider(nullptr, nullptr); } - for (auto stIndex = 0; stIndex < modeTagCount; stIndex++) + for (auto stIndex = 0; stIndex < semanticTagCount; stIndex++) { - uint32_t modeTagValue = 0; - uint32_t modeTagMfgCode = 0; - ModeTagType tag; + uint32_t semanticTagValue = 0; + uint32_t semanticTagMfgCode = 0; + SemanticTag tag; memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); - VerifyOrReturnValue(ESP32Config::KeyAllocator::ModeTagValue(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == + VerifyOrReturnValue(ESP32Config::KeyAllocator::SemanticTagValue(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); ESP32Config::Key stValueKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); - VerifyOrReturnValue(ESP32Config::ReadConfigValue(stValueKey, modeTagValue) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::ReadConfigValue(stValueKey, semanticTagValue) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); memset(keyBuf, 0, sizeof(char) * ESP32Config::kMaxConfigKeyNameLength); - VerifyOrReturnValue(ESP32Config::KeyAllocator::ModeTagMfgCode(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == + VerifyOrReturnValue(ESP32Config::KeyAllocator::SemanticTagMfgCode(keyBuf, sizeof(keyBuf), endpointId, index, stIndex) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); ESP32Config::Key stMfgCodeKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); - VerifyOrReturnValue(ESP32Config::ReadConfigValue(stMfgCodeKey, modeTagMfgCode) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::ReadConfigValue(stMfgCodeKey, semanticTagMfgCode) == CHIP_NO_ERROR, ModeOptionsProvider(nullptr, nullptr), CleanUp(endpointId)); - tag.value = static_cast(modeTagValue); - // tag.mfgCode = static_cast(modeTagMfgCode); - modeTags[stIndex] = tag; + tag.value = static_cast(semanticTagValue); + tag.mfgCode = static_cast(semanticTagMfgCode); + semanticTags[stIndex] = tag; } - option.label = chip::CharSpan::fromCharString(modeLabel); - option.mode = static_cast(supportedModeMode); - option.modeTags = DataModel::List(modeTags, modeTagCount); + option.label = chip::CharSpan::fromCharString(modeLabel); + option.mode = static_cast(supportedModeMode); + option.semanticTags = DataModel::List(semanticTags, semanticTagCount); modeOptionStructList[index] = option; } @@ -193,7 +194,7 @@ void StaticSupportedModesManager::FreeSupportedModes(EndpointId endpointId) cons { auto & modeOption = *it; delete[] modeOption.label.data(); - delete[] modeOption.modeTags.data(); + delete[] modeOption.semanticTags.data(); } delete[] begin; } diff --git a/examples/platform/esp32/mode-support/static-supported-modes-manager.h b/examples/platform/esp32/mode-support/static-supported-modes-manager.h index 9506f158e5d52a..689c9d059f4ab7 100644 --- a/examples/platform/esp32/mode-support/static-supported-modes-manager.h +++ b/examples/platform/esp32/mode-support/static-supported-modes-manager.h @@ -30,7 +30,7 @@ class StaticSupportedModesManager : public chip::app::Clusters::ModeSelect::Supp { private: using ModeOptionStructType = Structs::ModeOptionStruct::Type; - using ModeTag = Structs::ModeTagStruct::Type; + using SemanticTag = Structs::SemanticTagStruct::Type; static ModeOptionsProvider epModeOptionsProviderList[FIXED_ENDPOINT_COUNT]; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index e43d3afa2ca24c..075b8c7cc77237 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 0025fb8aa63a3c..418d7d4b82dd13 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 3ceab153db1fa4..c1a92de36a1b97 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index d7a1ec6b003f64..df4ac91800248b 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 85fcfa9afbbbdf..11cd0f27954c68 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 11c4b348cbe8a2..87d84e6abb923f 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 559e42c257415c..92dac22d2f131b 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index ba4f26b31b963b..1b555884166d66 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 7134768396864a..c026fb36a65a7a 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -23,7 +23,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/concentration-measurement-clu load "../src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/diagnostic-logs-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/ethernet-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/fan-control-cluster.xml"; @@ -37,13 +37,14 @@ load "../src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/identify-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/illuminance-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/level-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/localization-configuration-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/low-power-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/matter-devices.xml"; load "../src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/network-commissioning-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/occupancy-sensing-cluster.xml"; @@ -59,10 +60,10 @@ load "../src/app/zap-templates/zcl/data-model/chip/proxy-discovery-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/proxy-valid-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pump-configuration-and-control-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/pwm-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/relative-humidity-measurement-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/scene.xml"; load "../src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml"; diff --git a/src/app/tests/suites/TestModeSelectCluster.yaml b/src/app/tests/suites/TestModeSelectCluster.yaml index 17b5a4cb3876a6..3df5462041b374 100644 --- a/src/app/tests/suites/TestModeSelectCluster.yaml +++ b/src/app/tests/suites/TestModeSelectCluster.yaml @@ -33,15 +33,29 @@ tests: response: value: "Coffee" + - label: "Read StandardNamespace" + command: "readAttribute" + attribute: "StandardNamespace" + response: + value: 0 + - label: "Read SupportedModes" command: "readAttribute" attribute: "SupportedModes" response: value: [ - { Label: "Black", Mode: 0, ModeTags: [{ "Value": 0 }] }, - { Label: "Cappuccino", Mode: 4, ModeTags: [{ "Value": 0 }] }, - { Label: "Espresso", Mode: 7, ModeTags: [{ "Value": 0 }] }, + { Label: "Black", Mode: 0, SemanticTags: [{ "Value": 0 }] }, + { + Label: "Cappuccino", + Mode: 4, + SemanticTags: [{ "Value": 0 }], + }, + { + Label: "Espresso", + Mode: 7, + SemanticTags: [{ "Value": 0 }], + }, ] constraints: type: list diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 7aec7f0f260116..9364d830c45340 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -21,7 +21,7 @@ - + @@ -38,11 +38,12 @@ - + + @@ -58,10 +59,10 @@ - + - - + + diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml new file mode 100644 index 00000000000000..49e4d4c86ff105 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + General + Dishwasher Mode + 0x0059 + DISHWASHER_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml deleted file mode 100644 index 5814edebd43452..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-select-cluster.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - General - Dishwasher Mode Select - 0x0059 - DISHWASHER_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for dishwasher devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml new file mode 100644 index 00000000000000..3bea0e59d015ef --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-cluster.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + General + Laundry Washer Mode + 0x0051 + LAUNDRY_WASHER_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml deleted file mode 100644 index 52cc7039d5c621..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/laundry-washer-mode-select-cluster.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - General - Laundry Washer Mode Select - 0x0051 - LAUNDRY_WASHER_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for laundry washer devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml new file mode 100644 index 00000000000000..f0bb878ce09b7a --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/mode-base-cluster.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index 3df49aa9cdff84..7bf4c972972635 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -17,50 +17,17 @@ limitations under the License. - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + + @@ -71,52 +38,26 @@ limitations under the License. true true Attributes and commands for selecting a mode from a list of supported options. - - Description - - StandardNamespace - SupportedModes - CurrentMode - StartUpMode - OnMode - - + Description + StandardNamespace + SupportedModes + CurrentMode + StartUpMode + OnMode + + - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. + On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. - - + - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml new file mode 100644 index 00000000000000..aafc4f36af53f4 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + General + Refrigerator And Temperature Controlled Cabinet Mode + 0x0052 + REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml deleted file mode 100644 index 965dae53507ec4..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - General - Refrigerator And Temperature Controlled Cabinet Mode Select - 0x0052 - REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for refrigerator and temperature controlled cabinet devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml new file mode 100644 index 00000000000000..9ae08bb6cb6a3a --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-cluster.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + General + RVC Clean Mode + 0x0055 + RVC_CLEAN_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml deleted file mode 100644 index 9dcdc5e89dc569..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-clean-mode-select-cluster.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - General - RVC Clean Mode Select - 0x0055 - RVC_CLEAN_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster which also defines a namespace for the - cleaning type of the Robotic Vacuum Cleaner devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml new file mode 100644 index 00000000000000..ae5cc2163cc786 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-cluster.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + General + RVC Run Mode + 0x0054 + RVC_RUN_MODE_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + + SupportedModes + CurrentMode + StartUpMode + OnMode + + + + + This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. + + + + + + + This command is sent by the device on receipt of the ChangeToModeWithStatus command. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml deleted file mode 100644 index 6e1483d0be074b..00000000000000 --- a/src/app/zap-templates/zcl/data-model/chip/rvc-run-mode-select-cluster.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - General - RVC Run Mode Select - 0x0054 - RVC_RUN_MODE_SELECT_CLUSTER - true - true - This cluster is an alias of the Mode Select cluster which also defines a namespace for the running modes of the Robotic Vacuum Cleaner devices. - - - Description - SupportedModes - CurrentMode - StartUpMode - OnMode - - - - - If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. - - - - - - - This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - - - - - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - - - - - diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 2e5c502b4ed72a..07eca6ae3db3d3 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -35,7 +35,7 @@ "content-launch-cluster.xml", "descriptor-cluster.xml", "diagnostic-logs-cluster.xml", - "dishwasher-mode-select-cluster.xml", + "dishwasher-mode-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", "ethernet-network-diagnostics-cluster.xml", @@ -53,12 +53,13 @@ "illuminance-measurement-cluster.xml", "input-output-value-clusters.xml", "keypad-input-cluster.xml", - "laundry-washer-mode-select-cluster.xml", + "laundry-washer-mode-cluster.xml", "level-control-cluster.xml", "localization-configuration-cluster.xml", "low-power-cluster.xml", "media-input-cluster.xml", "media-playback-cluster.xml", + "mode-base-cluster.xml", "mode-select-cluster.xml", "mode-select-extensions.xml", "network-commissioning-cluster.xml", @@ -76,12 +77,12 @@ "proxy-valid-cluster.xml", "pump-configuration-and-control-cluster.xml", "pwm-cluster.xml", - "refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml", + "refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml", "refrigerator-alarm.xml", "relative-humidity-measurement-cluster.xml", "replacable-monitoring-cluster.xml", - "rvc-clean-mode-select-cluster.xml ", - "rvc-run-mode-select-cluster.xml", + "rvc-clean-mode-cluster.xml ", + "rvc-run-mode-cluster.xml", "resource-monitoring-cluster.xml", "scene.xml", "smoke-co-alarm-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index c7459b16080edc..24cc5cb2c4a6d1 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -34,7 +34,7 @@ "content-launch-cluster.xml", "descriptor-cluster.xml", "diagnostic-logs-cluster.xml", - "dishwasher-mode-select-cluster.xml", + "dishwasher-mode-cluster.xml", "door-lock-cluster.xml", "electrical-measurement-cluster.xml", "ethernet-network-diagnostics-cluster.xml", @@ -52,12 +52,13 @@ "illuminance-measurement-cluster.xml", "input-output-value-clusters.xml", "keypad-input-cluster.xml", - "laundry-washer-mode-select-cluster.xml", + "laundry-washer-mode-cluster.xml", "level-control-cluster.xml", "localization-configuration-cluster.xml", "low-power-cluster.xml", "media-input-cluster.xml", "media-playback-cluster.xml", + "mode-base-cluster.xml", "mode-select-cluster.xml", "network-commissioning-cluster.xml", "occupancy-sensing-cluster.xml", @@ -74,11 +75,11 @@ "proxy-valid-cluster.xml", "pump-configuration-and-control-cluster.xml", "pwm-cluster.xml", - "refrigerator-and-temperature-controlled-cabinet-mode-select-cluster.xml", + "refrigerator-and-temperature-controlled-cabinet-mode-cluster.xml", "refrigerator-alarm.xml", "relative-humidity-measurement-cluster.xml", - "rvc-clean-mode-select-cluster.xml ", - "rvc-run-mode-select-cluster.xml", + "rvc-clean-mode-cluster.xml ", + "rvc-run-mode-cluster.xml", "replacable-monitoring-cluster.xml", "resource-monitoring-cluster.xml", "scene.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 0e7b0c1593cd6a..7925bbf5ee5fd9 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -36,7 +36,7 @@ "DESCRIPTOR_CLUSTER": [], "DEVICE_TEMP_CLUSTER": [], "DIAGNOSTIC_LOGS_CLUSTER": [], - "DISHWASHER_MODE_SELECT_CLUSTER": [], + "DISHWASHER_MODE_CLUSTER": [], "DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER": [], "DOOR_LOCK_CLUSTER": [], "ELECTRICAL_MEASUREMENT_CLUSTER": [], @@ -67,7 +67,7 @@ "INK_CARTRIDGE_MONITORING_CLUSTER": [], "IONIZING_FILTER_MONITORING_CLUSTER": [], "KEYPAD_INPUT_CLUSTER": [], - "LAUNDRY_WASHER_MODE_SELECT_CLUSTER": [], + "LAUNDRY_WASHER_MODE_CLUSTER": [], "LEAD_CONCENTRATION_MEASUREMENT_CLUSTER": [], "LEVEL_CONTROL_CLUSTER": [], "LOCALIZATION_CONFIGURATION_CLUSTER": [], @@ -107,12 +107,12 @@ "pump-configuration-and-control-client" ], "PWM_CLUSTER": [], - "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER": [], + "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER": [], "RADON_CONCENTRATION_MEASUREMENT_CLUSTER": [], "REFRIGERATOR_ALARM": [], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], - "RVC_CLEAN_MODE_SELECT_CLUSTER": [], - "RVC_RUN_MODE_SELECT_CLUSTER": [], + "RVC_CLEAN_MODE_CLUSTER": [], + "RVC_RUN_MODE_CLUSTER": [], "SCENES_CLUSTER": [], "SMOKE_CO_ALARM_CLUSTER": [], "SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER": [], @@ -187,7 +187,7 @@ "DESCRIPTOR_CLUSTER": ["descriptor"], "DEVICE_TEMP_CLUSTER": [], "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], - "DISHWASHER_MODE_SELECT_CLUSTER": ["mode-select-server"], + "DISHWASHER_MODE_CLUSTER": ["mode-select-server"], "DISSOLVED_OXYGEN_CONCENTRATION_MEASUREMENT_CLUSTER": [], "DOOR_LOCK_CLUSTER": ["door-lock-server"], "ELECTRICAL_MEASUREMENT_CLUSTER": [], @@ -220,7 +220,7 @@ "INK_CARTRIDGE_MONITORING_CLUSTER": [], "IONIZING_FILTER_MONITORING_CLUSTER": [], "KEYPAD_INPUT_CLUSTER": ["keypad-input-server"], - "LAUNDRY_WASHER_MODE_SELECT_CLUSTER": ["mode-select-server"], + "LAUNDRY_WASHER_MODE_CLUSTER": ["mode-select-server"], "LEAD_CONCENTRATION_MEASUREMENT_CLUSTER": [], "LEVEL_CONTROL_CLUSTER": ["level-control"], "LOCALIZATION_CONFIGURATION_CLUSTER": [ @@ -264,13 +264,13 @@ "PWM_CLUSTER": [], "RADON_CONCENTRATION_MEASUREMENT_CLUSTER": [], "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], - "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER": [ + "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER": [ "mode-select-server" ], "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], - "RVC_CLEAN_MODE_SELECT_CLUSTER": ["mode-select-server"], - "RVC_RUN_MODE_SELECT_CLUSTER": ["mode-select-server"], + "RVC_CLEAN_MODE_CLUSTER": ["mode-select-server"], + "RVC_RUN_MODE_CLUSTER": ["mode-select-server"], "SCENES_CLUSTER": ["scenes-server"], "SMOKE_CO_ALARM_CLUSTER": ["smoke-co-alarm-server"], "SODIUM_CONCENTRATION_MEASUREMENT_CLUSTER": [], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index 3df33e1df39464..22f59e0292cb80 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -108,8 +108,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/DescriptorClient-ReadImpl.cpp", "jni/DiagnosticLogsClient-InvokeSubscribeImpl.cpp", "jni/DiagnosticLogsClient-ReadImpl.cpp", - "jni/DishwasherModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/DishwasherModeSelectClient-ReadImpl.cpp", + "jni/DishwasherModeClient-InvokeSubscribeImpl.cpp", + "jni/DishwasherModeClient-ReadImpl.cpp", "jni/DissolvedOxygenConcentrationMeasurementClient-InvokeSubscribeImpl.cpp", "jni/DissolvedOxygenConcentrationMeasurementClient-ReadImpl.cpp", "jni/DoorLockClient-InvokeSubscribeImpl.cpp", @@ -168,8 +168,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/IonizingFilterMonitoringClient-ReadImpl.cpp", "jni/KeypadInputClient-InvokeSubscribeImpl.cpp", "jni/KeypadInputClient-ReadImpl.cpp", - "jni/LaundryWasherModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/LaundryWasherModeSelectClient-ReadImpl.cpp", + "jni/LaundryWasherModeClient-InvokeSubscribeImpl.cpp", + "jni/LaundryWasherModeClient-ReadImpl.cpp", "jni/LeadConcentrationMeasurementClient-InvokeSubscribeImpl.cpp", "jni/LeadConcentrationMeasurementClient-ReadImpl.cpp", "jni/LevelControlClient-InvokeSubscribeImpl.cpp", @@ -238,16 +238,16 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RadonConcentrationMeasurementClient-ReadImpl.cpp", "jni/RefrigeratorAlarmClient-InvokeSubscribeImpl.cpp", "jni/RefrigeratorAlarmClient-ReadImpl.cpp", - "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/RefrigeratorAndTemperatureControlledCabinetModeSelectClient-ReadImpl.cpp", + "jni/RefrigeratorAndTemperatureControlledCabinetModeClient-InvokeSubscribeImpl.cpp", + "jni/RefrigeratorAndTemperatureControlledCabinetModeClient-ReadImpl.cpp", "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", "jni/RvcOperationalStateClient-InvokeSubscribeImpl.cpp", "jni/RvcOperationalStateClient-ReadImpl.cpp", - "jni/RvcCleanModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/RvcCleanModeSelectClient-ReadImpl.cpp", - "jni/RvcRunModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/RvcRunModeSelectClient-ReadImpl.cpp", + "jni/RvcCleanModeClient-InvokeSubscribeImpl.cpp", + "jni/RvcCleanModeClient-ReadImpl.cpp", + "jni/RvcRunModeClient-InvokeSubscribeImpl.cpp", + "jni/RvcRunModeClient-ReadImpl.cpp", "jni/ScenesClient-InvokeSubscribeImpl.cpp", "jni/ScenesClient-ReadImpl.cpp", "jni/SmokeCoAlarmClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 1117f47585b37e..a160909ea05ff4 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4,7 +4,6 @@ struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2763,44 +2762,23 @@ client cluster IcdManagement = 70 { /** Attributes and commands for selecting a mode from a list of supported options. */ client cluster ModeSelect = 80 { - enum ModeTag : ENUM16 { - kAuto = 0; - kQuick = 1; - kQuiet = 2; - kLowNoise = 3; - kLowEnergy = 4; - kVacation = 5; - kMin = 6; - kMax = 7; - kNight = 8; - kDay = 9; - } - - enum StatusCode : ENUM8 { - kSuccess = 0; - kUnsupportedMode = 1; - kGenericFailure = 2; - } - bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } - struct ModeTagStruct { - optional vendor_id mfgCode = 0; + struct SemanticTagStruct { + vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { char_string<64> label = 0; int8u mode = 1; - ModeTagStruct modeTags[] = 2; + SemanticTagStruct semanticTags[] = 2; } readonly attribute char_string<64> description = 0; - readonly attribute optional nullable enum16 standardNamespace = 1; + readonly attribute nullable enum16 standardNamespace = 1; readonly attribute ModeOptionStruct supportedModes[] = 2; readonly attribute int8u currentMode = 3; attribute optional nullable int8u startUpMode = 4; @@ -2816,27 +2794,12 @@ client cluster ModeSelect = 80 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { - ENUM8 status = 0; - optional CHAR_STRING statusText = 1; - } - - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ + /** On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; } -/** This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for laundry washer devices. */ -client cluster LaundryWasherModeSelect = 81 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster LaundryWasherMode = 81 { enum ModeTag : ENUM16 { kNormal = 16384; kDelicate = 16385; @@ -2846,13 +2809,11 @@ client cluster LaundryWasherModeSelect = 81 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2861,11 +2822,10 @@ client cluster LaundryWasherModeSelect = 81 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2877,27 +2837,18 @@ client cluster LaundryWasherModeSelect = 81 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } -/** This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for refrigerator and temperature controlled cabinet devices. */ -client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { enum ModeTag : ENUM16 { kRapidCool = 16384; kRapidFreeze = 16385; @@ -2905,13 +2856,11 @@ client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -2920,11 +2869,10 @@ client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2936,22 +2884,14 @@ client cluster RefrigeratorAndTemperatureControlledCabinetModeSelect = 82 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + 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. */ @@ -2973,8 +2913,8 @@ client cluster WasherControls = 83 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster is an alias of the Mode Select cluster which also defines a namespace for the running modes of the Robotic Vacuum Cleaner devices. */ -client cluster RvcRunModeSelect = 84 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster RvcRunMode = 84 { enum ModeTag : ENUM16 { kIdle = 16384; kCleaning = 16385; @@ -2993,13 +2933,11 @@ client cluster RvcRunModeSelect = 84 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -3008,11 +2946,10 @@ client cluster RvcRunModeSelect = 84 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3024,27 +2961,18 @@ client cluster RvcRunModeSelect = 84 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } -/** This cluster is an alias of the Mode Select cluster which also defines a namespace for the - cleaning type of the Robotic Vacuum Cleaner devices. */ -client cluster RvcCleanModeSelect = 85 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster RvcCleanMode = 85 { enum ModeTag : ENUM16 { kDeepClean = 16384; kVacuum = 16385; @@ -3057,13 +2985,11 @@ client cluster RvcCleanModeSelect = 85 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -3072,11 +2998,10 @@ client cluster RvcCleanModeSelect = 85 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3088,22 +3013,14 @@ client cluster RvcCleanModeSelect = 85 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes and commands for configuring the temperature control, and reporting temperature. */ @@ -3159,9 +3076,8 @@ client cluster RefrigeratorAlarm = 87 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster is an alias of the Mode Select cluster, defining additional semantics and - namespaced enumerated values for dishwasher devices. */ -client cluster DishwasherModeSelect = 89 { +/** Attributes and commands for selecting a mode from a list of supported options. */ +client cluster DishwasherMode = 89 { enum ModeTag : ENUM16 { kNormal = 16384; kHeavy = 16385; @@ -3170,13 +3086,11 @@ client cluster DishwasherModeSelect = 89 { bitmap Feature : BITMAP32 { kOnOff = 0x1; - kExtendedStatus = 0x2; } struct ModeTagStruct { optional vendor_id mfgCode = 0; enum16 value = 1; - optional char_string<64> tagName = 2; } struct ModeOptionStruct { @@ -3185,11 +3099,10 @@ client cluster DishwasherModeSelect = 89 { ModeTagStruct modeTags[] = 2; } - readonly attribute char_string<64> description = 0; - readonly attribute ModeOptionStruct supportedModes[] = 2; - readonly attribute int8u currentMode = 3; - attribute optional nullable int8u startUpMode = 4; - attribute optional nullable int8u onMode = 5; + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3201,22 +3114,14 @@ client cluster DishwasherModeSelect = 89 { INT8U newMode = 0; } - request struct ChangeToModeWithStatusRequest { - INT8U newMode = 0; - } - - response struct ChangeToModeResponse = 2 { + response struct ChangeToModeResponse = 1 { ENUM8 status = 0; optional CHAR_STRING statusText = 1; } - /** If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an INVALID_COMMAND status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device is unable to transition as requested, the server SHALL respond with a FAILURE status response. - If the NewMode field matches the Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. */ - command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - /** This command is used to change device modes using the same mechanism and semantics as ChangeToMode, and additionally obtaining a response with an ability for clients to determine causes of failures with fine-grained details. For status response depending on NewMode field, see ChangeToMode command. + /** This command is used to change device modes. On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - command ChangeToModeWithStatus(ChangeToModeWithStatusRequest): ChangeToModeResponse = 1; + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes for reporting air quality classification */ diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 9c13134213893e..4f78819037b7ef 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -10466,14 +10466,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -10487,7 +10479,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10503,7 +10495,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10518,16 +10510,6 @@ "define": "MODE_SELECT_CLUSTER", "side": "server", "enabled": 0, - "commands": [ - { - "name": "ChangeToModeResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], "attributes": [ { "name": "Description", @@ -10552,7 +10534,7 @@ "side": "server", "type": "enum16", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10568,10 +10550,10 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10599,7 +10581,7 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -10615,11 +10597,11 @@ "mfgCode": null, "side": "server", "type": "int8u", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10632,7 +10614,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10648,7 +10630,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10664,7 +10646,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10680,7 +10662,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10724,10 +10706,10 @@ ] }, { - "name": "Laundry Washer Mode Select", + "name": "Laundry Washer Mode", "code": 81, "mfgCode": null, - "define": "LAUNDRY_WASHER_MODE_SELECT_CLUSTER", + "define": "LAUNDRY_WASHER_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -10738,14 +10720,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -10759,7 +10733,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10775,7 +10749,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10784,16 +10758,16 @@ ] }, { - "name": "Laundry Washer Mode Select", + "name": "Laundry Washer Mode", "code": 81, "mfgCode": null, - "define": "LAUNDRY_WASHER_MODE_SELECT_CLUSTER", + "define": "LAUNDRY_WASHER_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -10819,12 +10793,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10835,7 +10809,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -10851,7 +10825,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -10867,7 +10841,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -10888,7 +10862,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10904,7 +10878,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10920,7 +10894,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10936,7 +10910,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -10971,7 +10945,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10980,10 +10954,10 @@ ] }, { - "name": "Refrigerator And Temperature Controlled Cabinet Mode Select", + "name": "Refrigerator And Temperature Controlled Cabinet Mode", "code": 82, "mfgCode": null, - "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER", + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -10994,14 +10968,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -11015,7 +10981,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11031,7 +10997,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11040,16 +11006,16 @@ ] }, { - "name": "Refrigerator And Temperature Controlled Cabinet Mode Select", + "name": "Refrigerator And Temperature Controlled Cabinet Mode", "code": 82, "mfgCode": null, - "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER", + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11075,12 +11041,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11091,7 +11057,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -11107,7 +11073,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -11123,7 +11089,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -11144,7 +11110,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11160,7 +11126,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11176,7 +11142,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11192,7 +11158,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11227,7 +11193,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11448,10 +11414,10 @@ ] }, { - "name": "RVC Run Mode Select", + "name": "RVC Run Mode", "code": 84, "mfgCode": null, - "define": "RVC_RUN_MODE_SELECT_CLUSTER", + "define": "RVC_RUN_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -11462,14 +11428,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -11483,7 +11441,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11499,7 +11457,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11508,16 +11466,16 @@ ] }, { - "name": "RVC Run Mode Select", + "name": "RVC Run Mode", "code": 84, "mfgCode": null, - "define": "RVC_RUN_MODE_SELECT_CLUSTER", + "define": "RVC_RUN_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11543,12 +11501,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11559,7 +11517,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -11575,7 +11533,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -11591,7 +11549,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -11612,7 +11570,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11628,7 +11586,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11644,7 +11602,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11660,7 +11618,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11695,7 +11653,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11704,10 +11662,10 @@ ] }, { - "name": "RVC Clean Mode Select", + "name": "RVC Clean Mode", "code": 85, "mfgCode": null, - "define": "RVC_CLEAN_MODE_SELECT_CLUSTER", + "define": "RVC_CLEAN_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -11718,14 +11676,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -11739,7 +11689,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11755,7 +11705,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -11764,16 +11714,16 @@ ] }, { - "name": "RVC Clean Mode Select", + "name": "RVC Clean Mode", "code": 85, "mfgCode": null, - "define": "RVC_CLEAN_MODE_SELECT_CLUSTER", + "define": "RVC_CLEAN_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11799,12 +11749,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11815,7 +11765,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -11831,7 +11781,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -11847,7 +11797,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -11868,7 +11818,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11884,7 +11834,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11900,7 +11850,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11916,7 +11866,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -11951,7 +11901,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12140,10 +12090,10 @@ ] }, { - "name": "Dishwasher Mode Select", + "name": "Dishwasher Mode", "code": 89, "mfgCode": null, - "define": "DISHWASHER_MODE_SELECT_CLUSTER", + "define": "DISHWASHER_MODE_CLUSTER", "side": "client", "enabled": 1, "commands": [ @@ -12154,14 +12104,6 @@ "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "ChangeToModeWithStatus", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -12175,7 +12117,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12191,7 +12133,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -12200,16 +12142,16 @@ ] }, { - "name": "Dishwasher Mode Select", + "name": "Dishwasher Mode", "code": 89, "mfgCode": null, - "define": "DISHWASHER_MODE_SELECT_CLUSTER", + "define": "DISHWASHER_MODE_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeToModeResponse", - "code": 2, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -12235,12 +12177,12 @@ }, { "name": "SupportedModes", - "code": 2, + "code": 1, "mfgCode": null, "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12251,7 +12193,7 @@ }, { "name": "CurrentMode", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "type": "int8u", @@ -12267,7 +12209,7 @@ }, { "name": "StartUpMode", - "code": 4, + "code": 3, "mfgCode": null, "side": "server", "type": "int8u", @@ -12283,7 +12225,7 @@ }, { "name": "OnMode", - "code": 5, + "code": 4, "mfgCode": null, "side": "server", "type": "int8u", @@ -12304,7 +12246,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12320,7 +12262,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12336,7 +12278,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12352,7 +12294,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12387,7 +12329,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index aca7a3f14c1079..3cd260b9e1aaf9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -154,20 +154,20 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ModeSelect.ID) { return new ModeSelect(); } - if (clusterId == LaundryWasherModeSelect.ID) { - return new LaundryWasherModeSelect(); + if (clusterId == LaundryWasherMode.ID) { + return new LaundryWasherMode(); } - if (clusterId == RefrigeratorAndTemperatureControlledCabinetModeSelect.ID) { - return new RefrigeratorAndTemperatureControlledCabinetModeSelect(); + if (clusterId == RefrigeratorAndTemperatureControlledCabinetMode.ID) { + return new RefrigeratorAndTemperatureControlledCabinetMode(); } if (clusterId == WasherControls.ID) { return new WasherControls(); } - if (clusterId == RvcRunModeSelect.ID) { - return new RvcRunModeSelect(); + if (clusterId == RvcRunMode.ID) { + return new RvcRunMode(); } - if (clusterId == RvcCleanModeSelect.ID) { - return new RvcCleanModeSelect(); + if (clusterId == RvcCleanMode.ID) { + return new RvcCleanMode(); } if (clusterId == TemperatureControl.ID) { return new TemperatureControl(); @@ -175,8 +175,8 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == RefrigeratorAlarm.ID) { return new RefrigeratorAlarm(); } - if (clusterId == DishwasherModeSelect.ID) { - return new DishwasherModeSelect(); + if (clusterId == DishwasherMode.ID) { + return new DishwasherMode(); } if (clusterId == AirQuality.ID) { return new AirQuality(); @@ -6253,8 +6253,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6289,23 +6288,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6336,18 +6318,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class LaundryWasherModeSelect implements BaseCluster { + public static class LaundryWasherMode implements BaseCluster { public static final long ID = 81L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6394,8 +6375,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6430,23 +6410,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6477,18 +6440,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RefrigeratorAndTemperatureControlledCabinetModeSelect implements BaseCluster { + public static class RefrigeratorAndTemperatureControlledCabinetMode implements BaseCluster { public static final long ID = 82L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6535,8 +6497,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6571,23 +6532,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6722,18 +6666,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RvcRunModeSelect implements BaseCluster { + public static class RvcRunMode implements BaseCluster { public static final long ID = 84L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6780,8 +6723,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6816,23 +6758,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -6863,18 +6788,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class RvcCleanModeSelect implements BaseCluster { + public static class RvcCleanMode implements BaseCluster { public static final long ID = 85L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -6921,8 +6845,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -6957,23 +6880,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); @@ -7231,18 +7137,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class DishwasherModeSelect implements BaseCluster { + public static class DishwasherMode implements BaseCluster { public static final long ID = 89L; public long getID() { return ID; } public enum Attribute { - Description(0L), - SupportedModes(2L), - CurrentMode(3L), - StartUpMode(4L), - OnMode(5L), + SupportedModes(0L), + CurrentMode(1L), + StartUpMode(2L), + OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -7289,8 +7194,7 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - ChangeToMode(0L), - ChangeToModeWithStatus(1L),; + ChangeToMode(0L),; private final long id; Command(long id) { this.id = id; @@ -7325,23 +7229,6 @@ public static ChangeToModeCommandField value(int id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum ChangeToModeWithStatusCommandField {NewMode(0),; - private final int id; - ChangeToModeWithStatusCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static ChangeToModeWithStatusCommandField value(int id) throws NoSuchFieldError { - for (ChangeToModeWithStatusCommandField field : ChangeToModeWithStatusCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } }@Override public String getAttributeName(long id) throws NoSuchFieldError { return Attribute.value(id).toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 71d3eded1bdba3..3faa2661db449f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -6056,253 +6056,231 @@ private static Map readModeSelectInteractionInfo() { return result; } - private static Map readLaundryWasherModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readLaundryWasherModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( + private static Map readLaundryWasherModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readLaundryWasherModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readLaundryWasherModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readLaundryWasherModeSelectDescriptionAttributeInteractionInfo); - Map readLaundryWasherModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.LaundryWasherModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterSupportedModesAttributeCallback(), - readLaundryWasherModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterSupportedModesAttributeCallback(), + readLaundryWasherModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readLaundryWasherModeSelectSupportedModesAttributeInteractionInfo); - Map readLaundryWasherModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readLaundryWasherModeSupportedModesAttributeInteractionInfo); + Map readLaundryWasherModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readLaundryWasherModeSelectCurrentModeCommandParams + readLaundryWasherModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readLaundryWasherModeSelectCurrentModeAttributeInteractionInfo); - Map readLaundryWasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readLaundryWasherModeCurrentModeAttributeInteractionInfo); + Map readLaundryWasherModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.LaundryWasherModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterStartUpModeAttributeCallback(), - readLaundryWasherModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterStartUpModeAttributeCallback(), + readLaundryWasherModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readLaundryWasherModeSelectStartUpModeAttributeInteractionInfo); - Map readLaundryWasherModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readLaundryWasherModeStartUpModeAttributeInteractionInfo); + Map readLaundryWasherModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readOnModeAttribute( + (ChipClusters.LaundryWasherModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterOnModeAttributeCallback(), - readLaundryWasherModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterOnModeAttributeCallback(), + readLaundryWasherModeOnModeCommandParams ); - result.put("readOnModeAttribute", readLaundryWasherModeSelectOnModeAttributeInteractionInfo); - Map readLaundryWasherModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readLaundryWasherModeOnModeAttributeInteractionInfo); + Map readLaundryWasherModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.LaundryWasherModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterGeneratedCommandListAttributeCallback(), - readLaundryWasherModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterGeneratedCommandListAttributeCallback(), + readLaundryWasherModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readLaundryWasherModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readLaundryWasherModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readLaundryWasherModeGeneratedCommandListAttributeInteractionInfo); + Map readLaundryWasherModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.LaundryWasherModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterAcceptedCommandListAttributeCallback(), - readLaundryWasherModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterAcceptedCommandListAttributeCallback(), + readLaundryWasherModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readLaundryWasherModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readLaundryWasherModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readLaundryWasherModeAcceptedCommandListAttributeInteractionInfo); + Map readLaundryWasherModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readEventListAttribute( + (ChipClusters.LaundryWasherModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterEventListAttributeCallback(), - readLaundryWasherModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterEventListAttributeCallback(), + readLaundryWasherModeEventListCommandParams ); - result.put("readEventListAttribute", readLaundryWasherModeSelectEventListAttributeInteractionInfo); - Map readLaundryWasherModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readLaundryWasherModeEventListAttributeInteractionInfo); + Map readLaundryWasherModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.LaundryWasherModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.LaundryWasherModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedLaundryWasherModeSelectClusterAttributeListAttributeCallback(), - readLaundryWasherModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedLaundryWasherModeClusterAttributeListAttributeCallback(), + readLaundryWasherModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readLaundryWasherModeSelectAttributeListAttributeInteractionInfo); - Map readLaundryWasherModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readLaundryWasherModeAttributeListAttributeInteractionInfo); + Map readLaundryWasherModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readLaundryWasherModeSelectFeatureMapCommandParams + readLaundryWasherModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readLaundryWasherModeSelectFeatureMapAttributeInteractionInfo); - Map readLaundryWasherModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readLaundryWasherModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readLaundryWasherModeFeatureMapAttributeInteractionInfo); + Map readLaundryWasherModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readLaundryWasherModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readLaundryWasherModeSelectClusterRevisionCommandParams + readLaundryWasherModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readLaundryWasherModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readLaundryWasherModeClusterRevisionAttributeInteractionInfo); return result; } - private static Map readRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( + private static Map readRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterSupportedModesAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesCommandParams ); - result.put("readDescriptionAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectDescriptionAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.SupportedModesAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterSupportedModesAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesCommandParams - ); - result.put("readSupportedModesAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeCommandParams + readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectCurrentModeAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeCurrentModeAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterStartUpModeAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterStartUpModeAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readOnModeAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterOnModeAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterOnModeAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams ); - result.put("readOnModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterGeneratedCommandListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterGeneratedCommandListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAcceptedCommandListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAcceptedCommandListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readEventListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterEventListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterEventListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeEventListCommandParams ); - result.put("readEventListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAttributeListAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAttributeListAttributeCallback(), + readRefrigeratorAndTemperatureControlledCabinetModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapCommandParams + readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectFeatureMapAttributeInteractionInfo); - Map readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRefrigeratorAndTemperatureControlledCabinetModeFeatureMapAttributeInteractionInfo); + Map readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionCommandParams + readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRefrigeratorAndTemperatureControlledCabinetModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRefrigeratorAndTemperatureControlledCabinetModeClusterRevisionAttributeInteractionInfo); return result; } @@ -6420,253 +6398,231 @@ private static Map readWasherControlsInteractionInfo() return result; } - private static Map readRvcRunModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRvcRunModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readRvcRunModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readRvcRunModeSelectDescriptionAttributeInteractionInfo); - Map readRvcRunModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + private static Map readRvcRunModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcRunModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.RvcRunModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.RvcRunModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterSupportedModesAttributeCallback(), - readRvcRunModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterSupportedModesAttributeCallback(), + readRvcRunModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readRvcRunModeSelectSupportedModesAttributeInteractionInfo); - Map readRvcRunModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readRvcRunModeSupportedModesAttributeInteractionInfo); + Map readRvcRunModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcRunModeSelectCurrentModeCommandParams + readRvcRunModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readRvcRunModeSelectCurrentModeAttributeInteractionInfo); - Map readRvcRunModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readRvcRunModeCurrentModeAttributeInteractionInfo); + Map readRvcRunModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.RvcRunModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.RvcRunModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterStartUpModeAttributeCallback(), - readRvcRunModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterStartUpModeAttributeCallback(), + readRvcRunModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readRvcRunModeSelectStartUpModeAttributeInteractionInfo); - Map readRvcRunModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readRvcRunModeStartUpModeAttributeInteractionInfo); + Map readRvcRunModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.RvcRunModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readOnModeAttribute( + (ChipClusters.RvcRunModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterOnModeAttributeCallback(), - readRvcRunModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterOnModeAttributeCallback(), + readRvcRunModeOnModeCommandParams ); - result.put("readOnModeAttribute", readRvcRunModeSelectOnModeAttributeInteractionInfo); - Map readRvcRunModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readRvcRunModeOnModeAttributeInteractionInfo); + Map readRvcRunModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RvcRunModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcRunModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterGeneratedCommandListAttributeCallback(), - readRvcRunModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterGeneratedCommandListAttributeCallback(), + readRvcRunModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRvcRunModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readRvcRunModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRvcRunModeGeneratedCommandListAttributeInteractionInfo); + Map readRvcRunModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RvcRunModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcRunModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterAcceptedCommandListAttributeCallback(), - readRvcRunModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterAcceptedCommandListAttributeCallback(), + readRvcRunModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRvcRunModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readRvcRunModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRvcRunModeAcceptedCommandListAttributeInteractionInfo); + Map readRvcRunModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.RvcRunModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readEventListAttribute( + (ChipClusters.RvcRunModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterEventListAttributeCallback(), - readRvcRunModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterEventListAttributeCallback(), + readRvcRunModeEventListCommandParams ); - result.put("readEventListAttribute", readRvcRunModeSelectEventListAttributeInteractionInfo); - Map readRvcRunModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRvcRunModeEventListAttributeInteractionInfo); + Map readRvcRunModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.RvcRunModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcRunModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcRunModeSelectClusterAttributeListAttributeCallback(), - readRvcRunModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcRunModeClusterAttributeListAttributeCallback(), + readRvcRunModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRvcRunModeSelectAttributeListAttributeInteractionInfo); - Map readRvcRunModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRvcRunModeAttributeListAttributeInteractionInfo); + Map readRvcRunModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRvcRunModeSelectFeatureMapCommandParams + readRvcRunModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRvcRunModeSelectFeatureMapAttributeInteractionInfo); - Map readRvcRunModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcRunModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRvcRunModeFeatureMapAttributeInteractionInfo); + Map readRvcRunModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcRunModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcRunModeSelectClusterRevisionCommandParams + readRvcRunModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRvcRunModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRvcRunModeClusterRevisionAttributeInteractionInfo); return result; } - private static Map readRvcCleanModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readRvcCleanModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( + private static Map readRvcCleanModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readRvcCleanModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.RvcCleanModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readRvcCleanModeSelectDescriptionCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterSupportedModesAttributeCallback(), + readRvcCleanModeSupportedModesCommandParams ); - result.put("readDescriptionAttribute", readRvcCleanModeSelectDescriptionAttributeInteractionInfo); - Map readRvcCleanModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readRvcCleanModeSupportedModesAttributeInteractionInfo); + Map readRvcCleanModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.RvcCleanModeSelectCluster.SupportedModesAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterSupportedModesAttributeCallback(), - readRvcCleanModeSelectSupportedModesCommandParams - ); - result.put("readSupportedModesAttribute", readRvcCleanModeSelectSupportedModesAttributeInteractionInfo); - Map readRvcCleanModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcCleanModeSelectCurrentModeCommandParams + readRvcCleanModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readRvcCleanModeSelectCurrentModeAttributeInteractionInfo); - Map readRvcCleanModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readRvcCleanModeCurrentModeAttributeInteractionInfo); + Map readRvcCleanModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.RvcCleanModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.RvcCleanModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterStartUpModeAttributeCallback(), - readRvcCleanModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterStartUpModeAttributeCallback(), + readRvcCleanModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readRvcCleanModeSelectStartUpModeAttributeInteractionInfo); - Map readRvcCleanModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readRvcCleanModeStartUpModeAttributeInteractionInfo); + Map readRvcCleanModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.RvcCleanModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readOnModeAttribute( + (ChipClusters.RvcCleanModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterOnModeAttributeCallback(), - readRvcCleanModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterOnModeAttributeCallback(), + readRvcCleanModeOnModeCommandParams ); - result.put("readOnModeAttribute", readRvcCleanModeSelectOnModeAttributeInteractionInfo); - Map readRvcCleanModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readRvcCleanModeOnModeAttributeInteractionInfo); + Map readRvcCleanModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.RvcCleanModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterGeneratedCommandListAttributeCallback(), - readRvcCleanModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterGeneratedCommandListAttributeCallback(), + readRvcCleanModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readRvcCleanModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readRvcCleanModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readRvcCleanModeGeneratedCommandListAttributeInteractionInfo); + Map readRvcCleanModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.RvcCleanModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterAcceptedCommandListAttributeCallback(), - readRvcCleanModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterAcceptedCommandListAttributeCallback(), + readRvcCleanModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readRvcCleanModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readRvcCleanModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readRvcCleanModeAcceptedCommandListAttributeInteractionInfo); + Map readRvcCleanModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readEventListAttribute( + (ChipClusters.RvcCleanModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterEventListAttributeCallback(), - readRvcCleanModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterEventListAttributeCallback(), + readRvcCleanModeEventListCommandParams ); - result.put("readEventListAttribute", readRvcCleanModeSelectEventListAttributeInteractionInfo); - Map readRvcCleanModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readRvcCleanModeEventListAttributeInteractionInfo); + Map readRvcCleanModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.RvcCleanModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.RvcCleanModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedRvcCleanModeSelectClusterAttributeListAttributeCallback(), - readRvcCleanModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedRvcCleanModeClusterAttributeListAttributeCallback(), + readRvcCleanModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readRvcCleanModeSelectAttributeListAttributeInteractionInfo); - Map readRvcCleanModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readRvcCleanModeAttributeListAttributeInteractionInfo); + Map readRvcCleanModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readRvcCleanModeSelectFeatureMapCommandParams + readRvcCleanModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readRvcCleanModeSelectFeatureMapAttributeInteractionInfo); - Map readRvcCleanModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readRvcCleanModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readRvcCleanModeFeatureMapAttributeInteractionInfo); + Map readRvcCleanModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readRvcCleanModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readRvcCleanModeSelectClusterRevisionCommandParams + readRvcCleanModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readRvcCleanModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readRvcCleanModeClusterRevisionAttributeInteractionInfo); return result; } @@ -6898,128 +6854,117 @@ private static Map readRefrigeratorAlarmInteractionInfo return result; } - private static Map readDishwasherModeSelectInteractionInfo() { - Map result = new LinkedHashMap<>();Map readDishwasherModeSelectDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readDishwasherModeSelectDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readDishwasherModeSelectDescriptionAttributeInteractionInfo); - Map readDishwasherModeSelectSupportedModesCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectSupportedModesAttributeInteractionInfo = new InteractionInfo( + private static Map readDishwasherModeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readDishwasherModeSupportedModesCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeSupportedModesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readSupportedModesAttribute( - (ChipClusters.DishwasherModeSelectCluster.SupportedModesAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readSupportedModesAttribute( + (ChipClusters.DishwasherModeCluster.SupportedModesAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterSupportedModesAttributeCallback(), - readDishwasherModeSelectSupportedModesCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterSupportedModesAttributeCallback(), + readDishwasherModeSupportedModesCommandParams ); - result.put("readSupportedModesAttribute", readDishwasherModeSelectSupportedModesAttributeInteractionInfo); - Map readDishwasherModeSelectCurrentModeCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectCurrentModeAttributeInteractionInfo = new InteractionInfo( + result.put("readSupportedModesAttribute", readDishwasherModeSupportedModesAttributeInteractionInfo); + Map readDishwasherModeCurrentModeCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeCurrentModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readCurrentModeAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).readCurrentModeAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readDishwasherModeSelectCurrentModeCommandParams + readDishwasherModeCurrentModeCommandParams ); - result.put("readCurrentModeAttribute", readDishwasherModeSelectCurrentModeAttributeInteractionInfo); - Map readDishwasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + result.put("readCurrentModeAttribute", readDishwasherModeCurrentModeAttributeInteractionInfo); + Map readDishwasherModeStartUpModeCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readStartUpModeAttribute( - (ChipClusters.DishwasherModeSelectCluster.StartUpModeAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readStartUpModeAttribute( + (ChipClusters.DishwasherModeCluster.StartUpModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterStartUpModeAttributeCallback(), - readDishwasherModeSelectStartUpModeCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterStartUpModeAttributeCallback(), + readDishwasherModeStartUpModeCommandParams ); - result.put("readStartUpModeAttribute", readDishwasherModeSelectStartUpModeAttributeInteractionInfo); - Map readDishwasherModeSelectOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + result.put("readStartUpModeAttribute", readDishwasherModeStartUpModeAttributeInteractionInfo); + Map readDishwasherModeOnModeCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readOnModeAttribute( - (ChipClusters.DishwasherModeSelectCluster.OnModeAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readOnModeAttribute( + (ChipClusters.DishwasherModeCluster.OnModeAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterOnModeAttributeCallback(), - readDishwasherModeSelectOnModeCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterOnModeAttributeCallback(), + readDishwasherModeOnModeCommandParams ); - result.put("readOnModeAttribute", readDishwasherModeSelectOnModeAttributeInteractionInfo); - Map readDishwasherModeSelectGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readOnModeAttribute", readDishwasherModeOnModeAttributeInteractionInfo); + Map readDishwasherModeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.DishwasherModeSelectCluster.GeneratedCommandListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.DishwasherModeCluster.GeneratedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterGeneratedCommandListAttributeCallback(), - readDishwasherModeSelectGeneratedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterGeneratedCommandListAttributeCallback(), + readDishwasherModeGeneratedCommandListCommandParams ); - result.put("readGeneratedCommandListAttribute", readDishwasherModeSelectGeneratedCommandListAttributeInteractionInfo); - Map readDishwasherModeSelectAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + result.put("readGeneratedCommandListAttribute", readDishwasherModeGeneratedCommandListAttributeInteractionInfo); + Map readDishwasherModeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.DishwasherModeSelectCluster.AcceptedCommandListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.DishwasherModeCluster.AcceptedCommandListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterAcceptedCommandListAttributeCallback(), - readDishwasherModeSelectAcceptedCommandListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterAcceptedCommandListAttributeCallback(), + readDishwasherModeAcceptedCommandListCommandParams ); - result.put("readAcceptedCommandListAttribute", readDishwasherModeSelectAcceptedCommandListAttributeInteractionInfo); - Map readDishwasherModeSelectEventListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectEventListAttributeInteractionInfo = new InteractionInfo( + result.put("readAcceptedCommandListAttribute", readDishwasherModeAcceptedCommandListAttributeInteractionInfo); + Map readDishwasherModeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeEventListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readEventListAttribute( - (ChipClusters.DishwasherModeSelectCluster.EventListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readEventListAttribute( + (ChipClusters.DishwasherModeCluster.EventListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterEventListAttributeCallback(), - readDishwasherModeSelectEventListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterEventListAttributeCallback(), + readDishwasherModeEventListCommandParams ); - result.put("readEventListAttribute", readDishwasherModeSelectEventListAttributeInteractionInfo); - Map readDishwasherModeSelectAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectAttributeListAttributeInteractionInfo = new InteractionInfo( + result.put("readEventListAttribute", readDishwasherModeEventListAttributeInteractionInfo); + Map readDishwasherModeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeAttributeListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readAttributeListAttribute( - (ChipClusters.DishwasherModeSelectCluster.AttributeListAttributeCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster).readAttributeListAttribute( + (ChipClusters.DishwasherModeCluster.AttributeListAttributeCallback) callback ); }, - () -> new ClusterInfoMapping.DelegatedDishwasherModeSelectClusterAttributeListAttributeCallback(), - readDishwasherModeSelectAttributeListCommandParams + () -> new ClusterInfoMapping.DelegatedDishwasherModeClusterAttributeListAttributeCallback(), + readDishwasherModeAttributeListCommandParams ); - result.put("readAttributeListAttribute", readDishwasherModeSelectAttributeListAttributeInteractionInfo); - Map readDishwasherModeSelectFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectFeatureMapAttributeInteractionInfo = new InteractionInfo( + result.put("readAttributeListAttribute", readDishwasherModeAttributeListAttributeInteractionInfo); + Map readDishwasherModeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeFeatureMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readFeatureMapAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).readFeatureMapAttribute( (ChipClusters.LongAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readDishwasherModeSelectFeatureMapCommandParams + readDishwasherModeFeatureMapCommandParams ); - result.put("readFeatureMapAttribute", readDishwasherModeSelectFeatureMapAttributeInteractionInfo); - Map readDishwasherModeSelectClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readDishwasherModeSelectClusterRevisionAttributeInteractionInfo = new InteractionInfo( + result.put("readFeatureMapAttribute", readDishwasherModeFeatureMapAttributeInteractionInfo); + Map readDishwasherModeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readDishwasherModeClusterRevisionAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).readClusterRevisionAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).readClusterRevisionAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readDishwasherModeSelectClusterRevisionCommandParams + readDishwasherModeClusterRevisionCommandParams ); - result.put("readClusterRevisionAttribute", readDishwasherModeSelectClusterRevisionAttributeInteractionInfo); + result.put("readClusterRevisionAttribute", readDishwasherModeClusterRevisionAttributeInteractionInfo); return result; } @@ -23325,14 +23270,14 @@ public Map> getReadAttributeMap() { put("booleanState", readBooleanStateInteractionInfo()); put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); - put("laundryWasherModeSelect", readLaundryWasherModeSelectInteractionInfo()); - put("refrigeratorAndTemperatureControlledCabinetModeSelect", readRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo()); + put("laundryWasherMode", readLaundryWasherModeInteractionInfo()); + put("refrigeratorAndTemperatureControlledCabinetMode", readRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo()); put("washerControls", readWasherControlsInteractionInfo()); - put("rvcRunModeSelect", readRvcRunModeSelectInteractionInfo()); - put("rvcCleanModeSelect", readRvcCleanModeSelectInteractionInfo()); + put("rvcRunMode", readRvcRunModeInteractionInfo()); + put("rvcCleanMode", readRvcCleanModeInteractionInfo()); put("temperatureControl", readTemperatureControlInteractionInfo()); put("refrigeratorAlarm", readRefrigeratorAlarmInteractionInfo()); - put("dishwasherModeSelect", readDishwasherModeSelectInteractionInfo()); + put("dishwasherMode", readDishwasherModeInteractionInfo()); put("airQuality", readAirQualityInteractionInfo()); put("smokeCoAlarm", readSmokeCoAlarmInteractionInfo()); put("operationalState", readOperationalStateInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 02f94db6e7a63d..a3e32eb5a39671 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -770,98 +770,98 @@ public Map> getWriteAttributeMap() { ); writeModeSelectInteractionInfo.put("writeOnModeAttribute", writeModeSelectOnModeAttributeInteractionInfo); writeAttributeMap.put("modeSelect", writeModeSelectInteractionInfo); - Map writeLaundryWasherModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeLaundryWasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectstartUpModeCommandParameterInfo = + Map writeLaundryWasherModeInteractionInfo = new LinkedHashMap<>(); + Map writeLaundryWasherModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo laundryWasherModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeLaundryWasherModeSelectStartUpModeCommandParams.put( + writeLaundryWasherModeStartUpModeCommandParams.put( "value", - laundryWasherModeSelectstartUpModeCommandParameterInfo + laundryWasherModestartUpModeCommandParameterInfo ); - InteractionInfo writeLaundryWasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeLaundryWasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeLaundryWasherModeSelectStartUpModeCommandParams + writeLaundryWasherModeStartUpModeCommandParams ); - writeLaundryWasherModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeLaundryWasherModeSelectStartUpModeAttributeInteractionInfo); - Map writeLaundryWasherModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectonModeCommandParameterInfo = + writeLaundryWasherModeInteractionInfo.put("writeStartUpModeAttribute", writeLaundryWasherModeStartUpModeAttributeInteractionInfo); + Map writeLaundryWasherModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo laundryWasherModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeLaundryWasherModeSelectOnModeCommandParams.put( + writeLaundryWasherModeOnModeCommandParams.put( "value", - laundryWasherModeSelectonModeCommandParameterInfo + laundryWasherModeonModeCommandParameterInfo ); - InteractionInfo writeLaundryWasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeLaundryWasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.LaundryWasherModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeLaundryWasherModeSelectOnModeCommandParams + writeLaundryWasherModeOnModeCommandParams ); - writeLaundryWasherModeSelectInteractionInfo.put("writeOnModeAttribute", writeLaundryWasherModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("laundryWasherModeSelect", writeLaundryWasherModeSelectInteractionInfo); - Map writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectstartUpModeCommandParameterInfo = + writeLaundryWasherModeInteractionInfo.put("writeOnModeAttribute", writeLaundryWasherModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("laundryWasherMode", writeLaundryWasherModeInteractionInfo); + Map writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo = new LinkedHashMap<>(); + Map writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams.put( + writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams.put( "value", - refrigeratorAndTemperatureControlledCabinetModeSelectstartUpModeCommandParameterInfo + refrigeratorAndTemperatureControlledCabinetModestartUpModeCommandParameterInfo ); - InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeCommandParams + writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeCommandParams ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeInteractionInfo); - Map writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectonModeCommandParameterInfo = + writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo.put("writeStartUpModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeInteractionInfo); + Map writeRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams.put( + writeRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams.put( "value", - refrigeratorAndTemperatureControlledCabinetModeSelectonModeCommandParameterInfo + refrigeratorAndTemperatureControlledCabinetModeonModeCommandParameterInfo ); - InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeCommandParams + writeRefrigeratorAndTemperatureControlledCabinetModeOnModeCommandParams ); - writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo.put("writeOnModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("refrigeratorAndTemperatureControlledCabinetModeSelect", writeRefrigeratorAndTemperatureControlledCabinetModeSelectInteractionInfo); + writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo.put("writeOnModeAttribute", writeRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("refrigeratorAndTemperatureControlledCabinetMode", writeRefrigeratorAndTemperatureControlledCabinetModeInteractionInfo); Map writeWasherControlsInteractionInfo = new LinkedHashMap<>(); Map writeWasherControlsSpinSpeedCurrentCommandParams = new LinkedHashMap(); CommandParameterInfo washerControlsspinSpeedCurrentCommandParameterInfo = @@ -908,148 +908,148 @@ public Map> getWriteAttributeMap() { ); writeWasherControlsInteractionInfo.put("writeNumberOfRinsesAttribute", writeWasherControlsNumberOfRinsesAttributeInteractionInfo); writeAttributeMap.put("washerControls", writeWasherControlsInteractionInfo); - Map writeRvcRunModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeRvcRunModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectstartUpModeCommandParameterInfo = + Map writeRvcRunModeInteractionInfo = new LinkedHashMap<>(); + Map writeRvcRunModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcRunModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcRunModeSelectStartUpModeCommandParams.put( + writeRvcRunModeStartUpModeCommandParams.put( "value", - rvcRunModeSelectstartUpModeCommandParameterInfo + rvcRunModestartUpModeCommandParameterInfo ); - InteractionInfo writeRvcRunModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcRunModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcRunModeSelectStartUpModeCommandParams + writeRvcRunModeStartUpModeCommandParams ); - writeRvcRunModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeRvcRunModeSelectStartUpModeAttributeInteractionInfo); - Map writeRvcRunModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectonModeCommandParameterInfo = + writeRvcRunModeInteractionInfo.put("writeStartUpModeAttribute", writeRvcRunModeStartUpModeAttributeInteractionInfo); + Map writeRvcRunModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcRunModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcRunModeSelectOnModeCommandParams.put( + writeRvcRunModeOnModeCommandParams.put( "value", - rvcRunModeSelectonModeCommandParameterInfo + rvcRunModeonModeCommandParameterInfo ); - InteractionInfo writeRvcRunModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcRunModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.RvcRunModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcRunModeSelectOnModeCommandParams + writeRvcRunModeOnModeCommandParams ); - writeRvcRunModeSelectInteractionInfo.put("writeOnModeAttribute", writeRvcRunModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("rvcRunModeSelect", writeRvcRunModeSelectInteractionInfo); - Map writeRvcCleanModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeRvcCleanModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectstartUpModeCommandParameterInfo = + writeRvcRunModeInteractionInfo.put("writeOnModeAttribute", writeRvcRunModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("rvcRunMode", writeRvcRunModeInteractionInfo); + Map writeRvcCleanModeInteractionInfo = new LinkedHashMap<>(); + Map writeRvcCleanModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcCleanModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcCleanModeSelectStartUpModeCommandParams.put( + writeRvcCleanModeStartUpModeCommandParams.put( "value", - rvcCleanModeSelectstartUpModeCommandParameterInfo + rvcCleanModestartUpModeCommandParameterInfo ); - InteractionInfo writeRvcCleanModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcCleanModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcCleanModeSelectStartUpModeCommandParams + writeRvcCleanModeStartUpModeCommandParams ); - writeRvcCleanModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeRvcCleanModeSelectStartUpModeAttributeInteractionInfo); - Map writeRvcCleanModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectonModeCommandParameterInfo = + writeRvcCleanModeInteractionInfo.put("writeStartUpModeAttribute", writeRvcCleanModeStartUpModeAttributeInteractionInfo); + Map writeRvcCleanModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcCleanModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeRvcCleanModeSelectOnModeCommandParams.put( + writeRvcCleanModeOnModeCommandParams.put( "value", - rvcCleanModeSelectonModeCommandParameterInfo + rvcCleanModeonModeCommandParameterInfo ); - InteractionInfo writeRvcCleanModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeRvcCleanModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.RvcCleanModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeRvcCleanModeSelectOnModeCommandParams + writeRvcCleanModeOnModeCommandParams ); - writeRvcCleanModeSelectInteractionInfo.put("writeOnModeAttribute", writeRvcCleanModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("rvcCleanModeSelect", writeRvcCleanModeSelectInteractionInfo); + writeRvcCleanModeInteractionInfo.put("writeOnModeAttribute", writeRvcCleanModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("rvcCleanMode", writeRvcCleanModeInteractionInfo); Map writeTemperatureControlInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("temperatureControl", writeTemperatureControlInteractionInfo); Map writeRefrigeratorAlarmInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("refrigeratorAlarm", writeRefrigeratorAlarmInteractionInfo); - Map writeDishwasherModeSelectInteractionInfo = new LinkedHashMap<>(); - Map writeDishwasherModeSelectStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectstartUpModeCommandParameterInfo = + Map writeDishwasherModeInteractionInfo = new LinkedHashMap<>(); + Map writeDishwasherModeStartUpModeCommandParams = new LinkedHashMap(); + CommandParameterInfo dishwasherModestartUpModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeDishwasherModeSelectStartUpModeCommandParams.put( + writeDishwasherModeStartUpModeCommandParams.put( "value", - dishwasherModeSelectstartUpModeCommandParameterInfo + dishwasherModestartUpModeCommandParameterInfo ); - InteractionInfo writeDishwasherModeSelectStartUpModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeDishwasherModeStartUpModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).writeStartUpModeAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).writeStartUpModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeDishwasherModeSelectStartUpModeCommandParams + writeDishwasherModeStartUpModeCommandParams ); - writeDishwasherModeSelectInteractionInfo.put("writeStartUpModeAttribute", writeDishwasherModeSelectStartUpModeAttributeInteractionInfo); - Map writeDishwasherModeSelectOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectonModeCommandParameterInfo = + writeDishwasherModeInteractionInfo.put("writeStartUpModeAttribute", writeDishwasherModeStartUpModeAttributeInteractionInfo); + Map writeDishwasherModeOnModeCommandParams = new LinkedHashMap(); + CommandParameterInfo dishwasherModeonModeCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeDishwasherModeSelectOnModeCommandParams.put( + writeDishwasherModeOnModeCommandParams.put( "value", - dishwasherModeSelectonModeCommandParameterInfo + dishwasherModeonModeCommandParameterInfo ); - InteractionInfo writeDishwasherModeSelectOnModeAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeDishwasherModeOnModeAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster).writeOnModeAttribute( + ((ChipClusters.DishwasherModeCluster) cluster).writeOnModeAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeDishwasherModeSelectOnModeCommandParams + writeDishwasherModeOnModeCommandParams ); - writeDishwasherModeSelectInteractionInfo.put("writeOnModeAttribute", writeDishwasherModeSelectOnModeAttributeInteractionInfo); - writeAttributeMap.put("dishwasherModeSelect", writeDishwasherModeSelectInteractionInfo); + writeDishwasherModeInteractionInfo.put("writeOnModeAttribute", writeDishwasherModeOnModeAttributeInteractionInfo); + writeAttributeMap.put("dishwasherMode", writeDishwasherModeInteractionInfo); Map writeAirQualityInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("airQuality", writeAirQualityInteractionInfo); Map writeSmokeCoAlarmInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 638e49c7024a79..12585d03b60a16 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -11953,68 +11953,47 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string newElement_0_modeCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_modeClassName.c_str(), newElement_0_modeCtorSignature.c_str(), entry_0.mode, newElement_0_mode); - jobject newElement_0_modeTags; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_modeTags); + jobject newElement_0_semanticTags; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_semanticTags); - auto iter_newElement_0_modeTags_2 = entry_0.modeTags.begin(); - while (iter_newElement_0_modeTags_2.Next()) + auto iter_newElement_0_semanticTags_2 = entry_0.semanticTags.begin(); + while (iter_newElement_0_semanticTags_2.Next()) { - auto & entry_2 = iter_newElement_0_modeTags_2.GetValue(); + auto & entry_2 = iter_newElement_0_semanticTags_2.GetValue(); jobject newElement_2; jobject newElement_2_mfgCode; - if (!entry_2.mfgCode.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_mfgCode); - } - else - { - jobject newElement_2_mfgCodeInsideOptional; - std::string newElement_2_mfgCodeInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_2_mfgCodeInsideOptionalCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_mfgCodeInsideOptionalClassName.c_str(), - newElement_2_mfgCodeInsideOptionalCtorSignature.c_str(), static_cast(entry_2.mfgCode.Value()), - newElement_2_mfgCodeInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_mfgCodeInsideOptional, newElement_2_mfgCode); - } + std::string newElement_2_mfgCodeClassName = "java/lang/Integer"; + std::string newElement_2_mfgCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_mfgCodeClassName.c_str(), newElement_2_mfgCodeCtorSignature.c_str(), + static_cast(entry_2.mfgCode), newElement_2_mfgCode); jobject newElement_2_value; std::string newElement_2_valueClassName = "java/lang/Integer"; std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } - jclass modeTagStructStructClass_3; + jclass semanticTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", + semanticTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); - if (modeTagStructStructCtor_3 == nullptr) + jmethodID semanticTagStructStructCtor_3 = + env->GetMethodID(semanticTagStructStructClass_3, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (semanticTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, + newElement_2_mfgCode, newElement_2_value); + chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); } jclass modeOptionStructStructClass_1; @@ -12034,7 +12013,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); + newElement_0_mode, newElement_0_semanticTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12230,22 +12209,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::LaundryWasherModeSelect::Id: { - using namespace app::Clusters::LaundryWasherModeSelect; + case app::Clusters::LaundryWasherMode::Id: { + using namespace app::Clusters::LaundryWasherMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12299,55 +12266,42 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct", + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); return nullptr; } @@ -12548,22 +12502,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { - using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect; + case app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -12617,69 +12559,52 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( env, - "chip/devicecontroller/" - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct", + "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct"); + ChipLogError( + Zcl, + "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError( - Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct " - "constructor"); + ChipLogError(Zcl, + "Could not find " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, - "chip/devicecontroller/" - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct", + env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct"); + ChipLogError( + Zcl, + "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError( - Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct " - "constructor"); + ChipLogError(Zcl, + "Could not find " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct constructor"); return nullptr; } @@ -13096,22 +13021,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RvcRunModeSelect::Id: { - using namespace app::Clusters::RvcRunModeSelect; + case app::Clusters::RvcRunMode::Id: { + using namespace app::Clusters::RvcRunMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -13165,54 +13078,41 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeOptionStruct", - modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); return nullptr; } @@ -13413,22 +13313,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::RvcCleanModeSelect::Id: { - using namespace app::Clusters::RvcCleanModeSelect; + case app::Clusters::RvcCleanMode::Id: { + using namespace app::Clusters::RvcCleanMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -13482,55 +13370,41 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeOptionStruct", - modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); return nullptr; } @@ -14129,22 +14003,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::DishwasherModeSelect::Id: { - using namespace app::Clusters::DishwasherModeSelect; + case app::Clusters::DishwasherMode::Id: { + using namespace app::Clusters::DishwasherMode; switch (aPath.mAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } case Attributes::SupportedModes::Id: { using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; @@ -14198,55 +14060,41 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject(newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); return nullptr; } newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeOptionStruct", - modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); return nullptr; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID( modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); return nullptr; } diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index e924882fb0d898..9e3c8a92513186 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -475,30 +475,29 @@ typedef void (*ModeSelectEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectSupportedModesListAttributeCallback)( +typedef void (*LaundryWasherModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> & data); -typedef void (*LaundryWasherModeSelectGeneratedCommandListListAttributeCallback)( + const chip::app::DataModel::DecodableList & + data); +typedef void (*LaundryWasherModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*LaundryWasherModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectEventListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*LaundryWasherModeSelectAttributeListListAttributeCallback)( +typedef void (*LaundryWasherModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*LaundryWasherModeAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSupportedModesListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType> & - data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListListAttributeCallback)( + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> & data); +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectEventListListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeEventListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListListAttributeCallback)( +typedef void (*RefrigeratorAndTemperatureControlledCabinetModeAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*WasherControlsSpinSpeedsListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); @@ -510,30 +509,28 @@ typedef void (*WasherControlsEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*WasherControlsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectSupportedModesListAttributeCallback)( +typedef void (*RvcRunModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & - data); -typedef void (*RvcRunModeSelectGeneratedCommandListListAttributeCallback)( + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcRunModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*RvcRunModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*RvcRunModeSelectAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectSupportedModesListAttributeCallback)( +typedef void (*RvcRunModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcRunModeAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & - data); -typedef void (*RvcCleanModeSelectGeneratedCommandListListAttributeCallback)( + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*RvcCleanModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*RvcCleanModeSelectAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*RvcCleanModeAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); typedef void (*TemperatureControlSupportedTemperatureLevelsListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TemperatureControlGeneratedCommandListListAttributeCallback)( @@ -552,17 +549,17 @@ typedef void (*RefrigeratorAlarmEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*RefrigeratorAlarmAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectSupportedModesListAttributeCallback)( +typedef void (*DishwasherModeSupportedModesListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectGeneratedCommandListListAttributeCallback)( +typedef void (*DishwasherModeGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectAcceptedCommandListListAttributeCallback)( +typedef void (*DishwasherModeAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*DishwasherModeSelectAttributeListListAttributeCallback)( +typedef void (*DishwasherModeEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*DishwasherModeAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 237ebacd4ac70c..4fe9a9ebc89a9e 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -2342,12 +2342,12 @@ JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, LaundryWasherModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, LaundryWasherModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::LaundryWasherModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::LaundryWasherMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2376,8 +2376,8 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LaundryWasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LaundryWasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2402,12 +2402,12 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, LaundryWasherModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, LaundryWasherModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::LaundryWasherModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::LaundryWasherMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2436,8 +2436,8 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - LaundryWasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LaundryWasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2462,12 +2462,12 @@ JNI_METHOD(void, LaundryWasherModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2497,8 +2497,8 @@ JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, w env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - RefrigeratorAndTemperatureControlledCabinetModeSelectCluster * cppCluster = - reinterpret_cast(clusterPtr); + RefrigeratorAndTemperatureControlledCabinetModeCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2523,12 +2523,12 @@ JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, w onFailure.release(); } -JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2558,8 +2558,8 @@ JNI_METHOD(void, RefrigeratorAndTemperatureControlledCabinetModeSelectCluster, w env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - RefrigeratorAndTemperatureControlledCabinetModeSelectCluster * cppCluster = - reinterpret_cast(clusterPtr); + RefrigeratorAndTemperatureControlledCabinetModeCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2704,12 +2704,12 @@ JNI_METHOD(void, WasherControlsCluster, writeNumberOfRinsesAttribute) onFailure.release(); } -JNI_METHOD(void, RvcRunModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, RvcRunModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcRunModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcRunMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2738,8 +2738,8 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcRunModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcRunModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2764,12 +2764,12 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, RvcRunModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, RvcRunModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcRunModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcRunMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2798,8 +2798,8 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcRunModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcRunModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2824,12 +2824,12 @@ JNI_METHOD(void, RvcRunModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, RvcCleanModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, RvcCleanModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcCleanModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcCleanMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2858,8 +2858,8 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcCleanModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcCleanModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2884,12 +2884,12 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, RvcCleanModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, RvcCleanModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::RvcCleanModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::RvcCleanMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2918,8 +2918,8 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RvcCleanModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RvcCleanModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -2944,12 +2944,12 @@ JNI_METHOD(void, RvcCleanModeSelectCluster, writeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, DishwasherModeSelectCluster, writeStartUpModeAttribute) +JNI_METHOD(void, DishwasherModeCluster, writeStartUpModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::DishwasherModeSelect::Attributes::StartUpMode::TypeInfo; + using TypeInfo = chip::app::Clusters::DishwasherMode::Attributes::StartUpMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -2978,8 +2978,8 @@ JNI_METHOD(void, DishwasherModeSelectCluster, writeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DishwasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DishwasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -3004,12 +3004,12 @@ JNI_METHOD(void, DishwasherModeSelectCluster, writeStartUpModeAttribute) onFailure.release(); } -JNI_METHOD(void, DishwasherModeSelectCluster, writeOnModeAttribute) +JNI_METHOD(void, DishwasherModeCluster, writeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) { chip::DeviceLayer::StackLock lock; ListFreer listFreer; - using TypeInfo = chip::app::Clusters::DishwasherModeSelect::Attributes::OnMode::TypeInfo; + using TypeInfo = chip::app::Clusters::DishwasherMode::Attributes::OnMode::TypeInfo; TypeInfo::Type cppValue; std::vector> cleanupByteArrays; @@ -3038,8 +3038,8 @@ JNI_METHOD(void, DishwasherModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - DishwasherModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DishwasherModeCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 9bea5c009ec831..ea8d604224fa77 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -2425,8 +2425,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::LaundryWasherModeSelect::Id: { - using namespace app::Clusters::LaundryWasherModeSelect; + case app::Clusters::LaundryWasherMode::Id: { + using namespace app::Clusters::LaundryWasherMode; switch (aPath.mEventId) { default: @@ -2435,8 +2435,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { - using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect; + case app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { + using namespace app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; switch (aPath.mEventId) { default: @@ -2455,8 +2455,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RvcRunModeSelect::Id: { - using namespace app::Clusters::RvcRunModeSelect; + case app::Clusters::RvcRunMode::Id: { + using namespace app::Clusters::RvcRunMode; switch (aPath.mEventId) { default: @@ -2465,8 +2465,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::RvcCleanModeSelect::Id: { - using namespace app::Clusters::RvcCleanModeSelect; + case app::Clusters::RvcCleanMode::Id: { + using namespace app::Clusters::RvcCleanMode; switch (aPath.mEventId) { default: @@ -2547,8 +2547,8 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::DishwasherModeSelect::Id: { - using namespace app::Clusters::DishwasherModeSelect; + case app::Clusters::DishwasherMode::Id: { + using namespace app::Clusters::DishwasherMode; switch (aPath.mEventId) { default: diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index be227349fbb7a8..0abae72ad343c9 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2811,82 +2811,9 @@ void CHIPIcdManagementClusterRegisterClientResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, ICDCounter); } -CHIPModeSelectClusterChangeToModeResponseCallback::CHIPModeSelectClusterChangeToModeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPModeSelectClusterChangeToModeResponseCallback::~CHIPModeSelectClusterChangeToModeResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject Status; - std::string StatusClassName = "java/lang/Integer"; - std::string StatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(StatusClassName.c_str(), StatusCtorSignature.c_str(), - dataResponse.status, Status); - jobject StatusText; - if (!dataResponse.statusText.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, StatusText); - } - else - { - jobject StatusTextInsideOptional; - LogErrorOnFailure( - chip::JniReferences::GetInstance().CharToStringUTF(dataResponse.statusText.Value(), StatusTextInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(StatusTextInsideOptional, StatusText); - } - - env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); -} -CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback( +CHIPLaundryWasherModeClusterChangeToModeResponseCallback::CHIPLaundryWasherModeClusterChangeToModeResponseCallback( jobject javaCallback) : - Callback::Callback(CallbackFn, this) + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2902,7 +2829,7 @@ CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CHIPLaundryWashe } } -CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::~CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback() +CHIPLaundryWasherModeClusterChangeToModeResponseCallback::~CHIPLaundryWasherModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2913,9 +2840,8 @@ CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::~CHIPLaundryWash env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPLaundryWasherModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2925,10 +2851,10 @@ void CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -2959,10 +2885,9 @@ void CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, - this) +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2978,8 +2903,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResp } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2990,10 +2915,10 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResp env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback::CallbackFn( void * context, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse:: - DecodableType & dataResponse) + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & + dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3003,12 +2928,11 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToMod VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr + std::unique_ptr cppCallback( - reinterpret_cast( - context), - chip::Platform::Delete); + reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3039,9 +2963,8 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToMod env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CHIPRvcRunModeSelectClusterChangeToModeResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPRvcRunModeClusterChangeToModeResponseCallback::CHIPRvcRunModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3057,7 +2980,7 @@ CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CHIPRvcRunModeSelectClu } } -CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::~CHIPRvcRunModeSelectClusterChangeToModeResponseCallback() +CHIPRvcRunModeClusterChangeToModeResponseCallback::~CHIPRvcRunModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3068,8 +2991,8 @@ CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::~CHIPRvcRunModeSelectCl env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPRvcRunModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3079,10 +3002,10 @@ void CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3113,9 +3036,8 @@ void CHIPRvcRunModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPRvcCleanModeClusterChangeToModeResponseCallback::CHIPRvcCleanModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3131,7 +3053,7 @@ CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CHIPRvcCleanModeSelec } } -CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::~CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback() +CHIPRvcCleanModeClusterChangeToModeResponseCallback::~CHIPRvcCleanModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3142,8 +3064,8 @@ CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::~CHIPRvcCleanModeSele env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPRvcCleanModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3153,10 +3075,10 @@ void CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -3187,9 +3109,8 @@ void CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, StatusText); } -CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CHIPDishwasherModeSelectClusterChangeToModeResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPDishwasherModeClusterChangeToModeResponseCallback::CHIPDishwasherModeClusterChangeToModeResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3205,7 +3126,7 @@ CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CHIPDishwasherModeS } } -CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::~CHIPDishwasherModeSelectClusterChangeToModeResponseCallback() +CHIPDishwasherModeClusterChangeToModeResponseCallback::~CHIPDishwasherModeClusterChangeToModeResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3216,8 +3137,8 @@ CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::~CHIPDishwasherMode env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & dataResponse) +void CHIPDishwasherModeClusterChangeToModeResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -3227,10 +3148,10 @@ void CHIPDishwasherModeSelectClusterChangeToModeResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 7e2685520d3a3c..2f93fd858fbec2 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -464,93 +464,78 @@ class CHIPIcdManagementClusterRegisterClientResponseCallback jobject javaCallbackRef; }; -class CHIPModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPLaundryWasherModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPLaundryWasherModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPModeSelectClusterChangeToModeResponseCallback(); + ~CHIPLaundryWasherModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPLaundryWasherModeSelectClusterChangeToModeResponseCallback(); + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(); - static void - CallbackFn(void * context, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback -{ -public: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); - - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands:: - ChangeToModeResponse::DecodableType & data); + static void CallbackFn( + void * context, + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & + data); private: jobject javaCallbackRef; }; -class CHIPRvcRunModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPRvcRunModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPRvcRunModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPRvcRunModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPRvcRunModeSelectClusterChangeToModeResponseCallback(); + ~CHIPRvcRunModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPRvcCleanModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPRvcCleanModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPRvcCleanModeSelectClusterChangeToModeResponseCallback(); + ~CHIPRvcCleanModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPDishwasherModeSelectClusterChangeToModeResponseCallback - : public Callback::Callback +class CHIPDishwasherModeClusterChangeToModeResponseCallback + : public Callback::Callback { public: - CHIPDishwasherModeSelectClusterChangeToModeResponseCallback(jobject javaCallback); + CHIPDishwasherModeClusterChangeToModeResponseCallback(jobject javaCallback); - ~CHIPDishwasherModeSelectClusterChangeToModeResponseCallback(); + ~CHIPDishwasherModeClusterChangeToModeResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & data); + const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & data); private: jobject javaCallbackRef; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 2c063769741b15..215fd94d28c22f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -19764,66 +19764,45 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_0_modeCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_modeClassName.c_str(), newElement_0_modeCtorSignature.c_str(), entry_0.mode, newElement_0_mode); - jobject newElement_0_modeTags; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_modeTags); + jobject newElement_0_semanticTags; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_semanticTags); - auto iter_newElement_0_modeTags_2 = entry_0.modeTags.begin(); - while (iter_newElement_0_modeTags_2.Next()) + auto iter_newElement_0_semanticTags_2 = entry_0.semanticTags.begin(); + while (iter_newElement_0_semanticTags_2.Next()) { - auto & entry_2 = iter_newElement_0_modeTags_2.GetValue(); + auto & entry_2 = iter_newElement_0_semanticTags_2.GetValue(); jobject newElement_2; jobject newElement_2_mfgCode; - if (!entry_2.mfgCode.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_mfgCode); - } - else - { - jobject newElement_2_mfgCodeInsideOptional; - std::string newElement_2_mfgCodeInsideOptionalClassName = "java/lang/Integer"; - std::string newElement_2_mfgCodeInsideOptionalCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2_mfgCodeInsideOptionalClassName.c_str(), newElement_2_mfgCodeInsideOptionalCtorSignature.c_str(), - static_cast(entry_2.mfgCode.Value()), newElement_2_mfgCodeInsideOptional); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_mfgCodeInsideOptional, newElement_2_mfgCode); - } + std::string newElement_2_mfgCodeClassName = "java/lang/Integer"; + std::string newElement_2_mfgCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_mfgCodeClassName.c_str(), newElement_2_mfgCodeCtorSignature.c_str(), + static_cast(entry_2.mfgCode), newElement_2_mfgCode); jobject newElement_2_value; std::string newElement_2_valueClassName = "java/lang/Integer"; std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } - jclass modeTagStructStructClass_3; + jclass semanticTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", semanticTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); - if (modeTagStructStructCtor_3 == nullptr) + jmethodID semanticTagStructStructCtor_3 = + env->GetMethodID(semanticTagStructStructClass_3, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (semanticTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); } jclass modeOptionStructStructClass_1; @@ -19843,7 +19822,7 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( } newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); + newElement_0_mode, newElement_0_semanticTags); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -20259,9 +20238,9 @@ void CHIPModeSelectAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CHIPLaundryWasherModeSelectSupportedModesAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeSupportedModesAttributeCallback::CHIPLaundryWasherModeSupportedModesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20278,7 +20257,7 @@ CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CHIPLaundryWasherMod } } -CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::~CHIPLaundryWasherModeSelectSupportedModesAttributeCallback() +CHIPLaundryWasherModeSupportedModesAttributeCallback::~CHIPLaundryWasherModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20289,10 +20268,10 @@ CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::~CHIPLaundryWasherMo env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> & list) + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20301,8 +20280,8 @@ void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20356,53 +20335,41 @@ void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); return; } @@ -20415,9 +20382,9 @@ void CHIPLaundryWasherModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CHIPLaundryWasherModeSelectStartUpModeAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeStartUpModeAttributeCallback::CHIPLaundryWasherModeStartUpModeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20434,7 +20401,7 @@ CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CHIPLaundryWasherModeSe } } -CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::~CHIPLaundryWasherModeSelectStartUpModeAttributeCallback() +CHIPLaundryWasherModeStartUpModeAttributeCallback::~CHIPLaundryWasherModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20445,8 +20412,8 @@ CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::~CHIPLaundryWasherModeS env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPLaundryWasherModeStartUpModeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20454,8 +20421,8 @@ void CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20482,10 +20449,8 @@ void CHIPLaundryWasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPLaundryWasherModeSelectOnModeAttributeCallback::CHIPLaundryWasherModeSelectOnModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPLaundryWasherModeOnModeAttributeCallback::CHIPLaundryWasherModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20501,7 +20466,7 @@ CHIPLaundryWasherModeSelectOnModeAttributeCallback::CHIPLaundryWasherModeSelectO } } -CHIPLaundryWasherModeSelectOnModeAttributeCallback::~CHIPLaundryWasherModeSelectOnModeAttributeCallback() +CHIPLaundryWasherModeOnModeAttributeCallback::~CHIPLaundryWasherModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20512,8 +20477,7 @@ CHIPLaundryWasherModeSelectOnModeAttributeCallback::~CHIPLaundryWasherModeSelect env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPLaundryWasherModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20521,8 +20485,8 @@ void CHIPLaundryWasherModeSelectOnModeAttributeCallback::CallbackFn(void * conte jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20549,9 +20513,9 @@ void CHIPLaundryWasherModeSelectOnModeAttributeCallback::CallbackFn(void * conte env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback( +CHIPLaundryWasherModeGeneratedCommandListAttributeCallback::CHIPLaundryWasherModeGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20568,8 +20532,7 @@ CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CHIPLaundryWas } } -CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback:: - ~CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback() +CHIPLaundryWasherModeGeneratedCommandListAttributeCallback::~CHIPLaundryWasherModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20580,7 +20543,7 @@ CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -20590,8 +20553,8 @@ void CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CallbackF VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20621,9 +20584,9 @@ void CHIPLaundryWasherModeSelectGeneratedCommandListAttributeCallback::CallbackF env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback( +CHIPLaundryWasherModeAcceptedCommandListAttributeCallback::CHIPLaundryWasherModeAcceptedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20640,7 +20603,7 @@ CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CHIPLaundryWash } } -CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::~CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback() +CHIPLaundryWasherModeAcceptedCommandListAttributeCallback::~CHIPLaundryWasherModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20651,7 +20614,7 @@ CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::~CHIPLaundryWas env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -20661,8 +20624,8 @@ void CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20692,9 +20655,9 @@ void CHIPLaundryWasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectEventListAttributeCallback::CHIPLaundryWasherModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeEventListAttributeCallback::CHIPLaundryWasherModeEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20711,7 +20674,7 @@ CHIPLaundryWasherModeSelectEventListAttributeCallback::CHIPLaundryWasherModeSele } } -CHIPLaundryWasherModeSelectEventListAttributeCallback::~CHIPLaundryWasherModeSelectEventListAttributeCallback() +CHIPLaundryWasherModeEventListAttributeCallback::~CHIPLaundryWasherModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20722,8 +20685,8 @@ CHIPLaundryWasherModeSelectEventListAttributeCallback::~CHIPLaundryWasherModeSel env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPLaundryWasherModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20732,8 +20695,8 @@ void CHIPLaundryWasherModeSelectEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20763,9 +20726,9 @@ void CHIPLaundryWasherModeSelectEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CHIPLaundryWasherModeSelectAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPLaundryWasherModeAttributeListAttributeCallback::CHIPLaundryWasherModeAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -20782,7 +20745,7 @@ CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CHIPLaundryWasherMode } } -CHIPLaundryWasherModeSelectAttributeListAttributeCallback::~CHIPLaundryWasherModeSelectAttributeListAttributeCallback() +CHIPLaundryWasherModeAttributeListAttributeCallback::~CHIPLaundryWasherModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20793,7 +20756,7 @@ CHIPLaundryWasherModeSelectAttributeListAttributeCallback::~CHIPLaundryWasherMod env->DeleteGlobalRef(javaCallbackRef); } -void CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CallbackFn( +void CHIPLaundryWasherModeAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -20803,8 +20766,8 @@ void CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20834,9 +20797,9 @@ void CHIPLaundryWasherModeSelectAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) { @@ -20854,8 +20817,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttribute } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -20866,11 +20829,10 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttribute env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeSupportedModesAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType> & - list) + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -20879,11 +20841,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttr VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -20937,63 +20897,49 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttr std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct", + env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct"); + Zcl, "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct", + env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct constructor"); return; } @@ -21006,10 +20952,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectSupportedModesAttr env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( - CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21026,8 +20972,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCal } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21038,7 +20984,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCal env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeStartUpModeAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; @@ -21047,10 +20993,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttribu jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -21077,10 +21022,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectStartUpModeAttribu env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( - CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21097,8 +21042,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21109,7 +21054,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeOnModeAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; @@ -21118,8 +21063,8 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCal jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback(reinterpret_cast(context), + std::unique_ptr + cppCallback(reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. @@ -21147,12 +21092,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectOnModeAttributeCal env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback< - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterGeneratedCommandListAttributeCallbackType>(CallbackFn, - this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( + CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21169,8 +21112,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAtt } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21181,7 +21124,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21191,11 +21134,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandLi VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast( - context), + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. @@ -21226,11 +21168,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectGeneratedCommandLi env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback< - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAcceptedCommandListAttributeCallbackType>(CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( + CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21247,8 +21188,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttr } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21259,7 +21200,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21269,11 +21210,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandLis VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast( - context), + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. @@ -21304,10 +21244,10 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAcceptedCommandLis env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( - CallbackFn, this), +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -21324,8 +21264,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallb } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21336,7 +21276,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallb env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeEventListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21346,10 +21286,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttribute VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -21379,9 +21318,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectEventListAttribute env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback:: - CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback( +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: + CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback( CallbackFn, this), keepAlive(keepAlive) { @@ -21399,8 +21338,8 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeC } } -CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback:: - ~CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback() +CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback:: + ~CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21411,7 +21350,7 @@ CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeC env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttributeCallback::CallbackFn( +void CHIPRefrigeratorAndTemperatureControlledCabinetModeAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -21421,11 +21360,9 @@ void CHIPRefrigeratorAndTemperatureControlledCabinetModeSelectAttributeListAttri VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr - cppCallback( - reinterpret_cast(context), - maybeDestroy); + std::unique_ptr + cppCallback(reinterpret_cast(context), + maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -21937,10 +21874,8 @@ void CHIPWasherControlsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectSupportedModesAttributeCallback::CHIPRvcRunModeSelectSupportedModesAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeSupportedModesAttributeCallback::CHIPRvcRunModeSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21956,7 +21891,7 @@ CHIPRvcRunModeSelectSupportedModesAttributeCallback::CHIPRvcRunModeSelectSupport } } -CHIPRvcRunModeSelectSupportedModesAttributeCallback::~CHIPRvcRunModeSelectSupportedModesAttributeCallback() +CHIPRvcRunModeSupportedModesAttributeCallback::~CHIPRvcRunModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -21967,10 +21902,9 @@ CHIPRvcRunModeSelectSupportedModesAttributeCallback::~CHIPRvcRunModeSelectSuppor env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPRvcRunModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -21979,8 +21913,8 @@ void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22034,53 +21968,41 @@ void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); return; } @@ -22093,10 +22015,8 @@ void CHIPRvcRunModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectStartUpModeAttributeCallback::CHIPRvcRunModeSelectStartUpModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeStartUpModeAttributeCallback::CHIPRvcRunModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22112,7 +22032,7 @@ CHIPRvcRunModeSelectStartUpModeAttributeCallback::CHIPRvcRunModeSelectStartUpMod } } -CHIPRvcRunModeSelectStartUpModeAttributeCallback::~CHIPRvcRunModeSelectStartUpModeAttributeCallback() +CHIPRvcRunModeStartUpModeAttributeCallback::~CHIPRvcRunModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22123,8 +22043,7 @@ CHIPRvcRunModeSelectStartUpModeAttributeCallback::~CHIPRvcRunModeSelectStartUpMo env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPRvcRunModeStartUpModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22132,8 +22051,8 @@ void CHIPRvcRunModeSelectStartUpModeAttributeCallback::CallbackFn(void * context jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22160,8 +22079,8 @@ void CHIPRvcRunModeSelectStartUpModeAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcRunModeSelectOnModeAttributeCallback::CHIPRvcRunModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPRvcRunModeOnModeAttributeCallback::CHIPRvcRunModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22177,7 +22096,7 @@ CHIPRvcRunModeSelectOnModeAttributeCallback::CHIPRvcRunModeSelectOnModeAttribute } } -CHIPRvcRunModeSelectOnModeAttributeCallback::~CHIPRvcRunModeSelectOnModeAttributeCallback() +CHIPRvcRunModeOnModeAttributeCallback::~CHIPRvcRunModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22188,7 +22107,7 @@ CHIPRvcRunModeSelectOnModeAttributeCallback::~CHIPRvcRunModeSelectOnModeAttribut env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) +void CHIPRvcRunModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22196,8 +22115,8 @@ void CHIPRvcRunModeSelectOnModeAttributeCallback::CallbackFn(void * context, con jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22224,9 +22143,9 @@ void CHIPRvcRunModeSelectOnModeAttributeCallback::CallbackFn(void * context, con env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcRunModeGeneratedCommandListAttributeCallback::CHIPRvcRunModeGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22243,7 +22162,7 @@ CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CHIPRvcRunModeSelectG } } -CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback() +CHIPRvcRunModeGeneratedCommandListAttributeCallback::~CHIPRvcRunModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22254,7 +22173,7 @@ CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcRunModeSelect env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRvcRunModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22264,8 +22183,8 @@ void CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22295,9 +22214,9 @@ void CHIPRvcRunModeSelectGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcRunModeAcceptedCommandListAttributeCallback::CHIPRvcRunModeAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22314,7 +22233,7 @@ CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CHIPRvcRunModeSelectAc } } -CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback() +CHIPRvcRunModeAcceptedCommandListAttributeCallback::~CHIPRvcRunModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22325,7 +22244,7 @@ CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcRunModeSelectA env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRvcRunModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22335,8 +22254,8 @@ void CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22366,10 +22285,8 @@ void CHIPRvcRunModeSelectAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectEventListAttributeCallback::CHIPRvcRunModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeEventListAttributeCallback::CHIPRvcRunModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22385,7 +22302,7 @@ CHIPRvcRunModeSelectEventListAttributeCallback::CHIPRvcRunModeSelectEventListAtt } } -CHIPRvcRunModeSelectEventListAttributeCallback::~CHIPRvcRunModeSelectEventListAttributeCallback() +CHIPRvcRunModeEventListAttributeCallback::~CHIPRvcRunModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22396,8 +22313,8 @@ CHIPRvcRunModeSelectEventListAttributeCallback::~CHIPRvcRunModeSelectEventListAt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPRvcRunModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22406,8 +22323,8 @@ void CHIPRvcRunModeSelectEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22437,10 +22354,8 @@ void CHIPRvcRunModeSelectEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcRunModeSelectAttributeListAttributeCallback::CHIPRvcRunModeSelectAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcRunModeAttributeListAttributeCallback::CHIPRvcRunModeAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22456,7 +22371,7 @@ CHIPRvcRunModeSelectAttributeListAttributeCallback::CHIPRvcRunModeSelectAttribut } } -CHIPRvcRunModeSelectAttributeListAttributeCallback::~CHIPRvcRunModeSelectAttributeListAttributeCallback() +CHIPRvcRunModeAttributeListAttributeCallback::~CHIPRvcRunModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22467,8 +22382,8 @@ CHIPRvcRunModeSelectAttributeListAttributeCallback::~CHIPRvcRunModeSelectAttribu env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcRunModeSelectAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPRvcRunModeAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22477,8 +22392,8 @@ void CHIPRvcRunModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22508,9 +22423,9 @@ void CHIPRvcRunModeSelectAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CHIPRvcCleanModeSelectSupportedModesAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeSupportedModesAttributeCallback::CHIPRvcCleanModeSupportedModesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22527,7 +22442,7 @@ CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CHIPRvcCleanModeSelectSup } } -CHIPRvcCleanModeSelectSupportedModesAttributeCallback::~CHIPRvcCleanModeSelectSupportedModesAttributeCallback() +CHIPRvcCleanModeSupportedModesAttributeCallback::~CHIPRvcCleanModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22538,10 +22453,9 @@ CHIPRvcCleanModeSelectSupportedModesAttributeCallback::~CHIPRvcCleanModeSelectSu env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPRvcCleanModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22550,8 +22464,8 @@ void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22605,53 +22519,41 @@ void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); return; } @@ -22664,10 +22566,8 @@ void CHIPRvcCleanModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CHIPRvcCleanModeSelectStartUpModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcCleanModeStartUpModeAttributeCallback::CHIPRvcCleanModeStartUpModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22683,7 +22583,7 @@ CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CHIPRvcCleanModeSelectStartU } } -CHIPRvcCleanModeSelectStartUpModeAttributeCallback::~CHIPRvcCleanModeSelectStartUpModeAttributeCallback() +CHIPRvcCleanModeStartUpModeAttributeCallback::~CHIPRvcCleanModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22694,8 +22594,7 @@ CHIPRvcCleanModeSelectStartUpModeAttributeCallback::~CHIPRvcCleanModeSelectStart env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPRvcCleanModeStartUpModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22703,8 +22602,8 @@ void CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CallbackFn(void * conte jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22731,8 +22630,8 @@ void CHIPRvcCleanModeSelectStartUpModeAttributeCallback::CallbackFn(void * conte env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcCleanModeSelectOnModeAttributeCallback::CHIPRvcCleanModeSelectOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPRvcCleanModeOnModeAttributeCallback::CHIPRvcCleanModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22748,7 +22647,7 @@ CHIPRvcCleanModeSelectOnModeAttributeCallback::CHIPRvcCleanModeSelectOnModeAttri } } -CHIPRvcCleanModeSelectOnModeAttributeCallback::~CHIPRvcCleanModeSelectOnModeAttributeCallback() +CHIPRvcCleanModeOnModeAttributeCallback::~CHIPRvcCleanModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22759,8 +22658,7 @@ CHIPRvcCleanModeSelectOnModeAttributeCallback::~CHIPRvcCleanModeSelectOnModeAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectOnModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPRvcCleanModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22768,8 +22666,8 @@ void CHIPRvcCleanModeSelectOnModeAttributeCallback::CallbackFn(void * context, jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22796,9 +22694,9 @@ void CHIPRvcCleanModeSelectOnModeAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeGeneratedCommandListAttributeCallback::CHIPRvcCleanModeGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22815,7 +22713,7 @@ CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CHIPRvcCleanModeSel } } -CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback() +CHIPRvcCleanModeGeneratedCommandListAttributeCallback::~CHIPRvcCleanModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22826,7 +22724,7 @@ CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::~CHIPRvcCleanModeSe env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPRvcCleanModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22836,8 +22734,8 @@ void CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22867,9 +22765,9 @@ void CHIPRvcCleanModeSelectGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeAcceptedCommandListAttributeCallback::CHIPRvcCleanModeAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -22886,7 +22784,7 @@ CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CHIPRvcCleanModeSele } } -CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback() +CHIPRvcCleanModeAcceptedCommandListAttributeCallback::~CHIPRvcCleanModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22897,7 +22795,7 @@ CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::~CHIPRvcCleanModeSel env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPRvcCleanModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -22907,8 +22805,8 @@ void CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -22938,10 +22836,8 @@ void CHIPRvcCleanModeSelectAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectEventListAttributeCallback::CHIPRvcCleanModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPRvcCleanModeEventListAttributeCallback::CHIPRvcCleanModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22957,7 +22853,7 @@ CHIPRvcCleanModeSelectEventListAttributeCallback::CHIPRvcCleanModeSelectEventLis } } -CHIPRvcCleanModeSelectEventListAttributeCallback::~CHIPRvcCleanModeSelectEventListAttributeCallback() +CHIPRvcCleanModeEventListAttributeCallback::~CHIPRvcCleanModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -22968,8 +22864,8 @@ CHIPRvcCleanModeSelectEventListAttributeCallback::~CHIPRvcCleanModeSelectEventLi env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPRvcCleanModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -22978,8 +22874,8 @@ void CHIPRvcCleanModeSelectEventListAttributeCallback::CallbackFn(void * context VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23009,9 +22905,9 @@ void CHIPRvcCleanModeSelectEventListAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPRvcCleanModeSelectAttributeListAttributeCallback::CHIPRvcCleanModeSelectAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPRvcCleanModeAttributeListAttributeCallback::CHIPRvcCleanModeAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -23028,7 +22924,7 @@ CHIPRvcCleanModeSelectAttributeListAttributeCallback::CHIPRvcCleanModeSelectAttr } } -CHIPRvcCleanModeSelectAttributeListAttributeCallback::~CHIPRvcCleanModeSelectAttributeListAttributeCallback() +CHIPRvcCleanModeAttributeListAttributeCallback::~CHIPRvcCleanModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23039,8 +22935,8 @@ CHIPRvcCleanModeSelectAttributeListAttributeCallback::~CHIPRvcCleanModeSelectAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPRvcCleanModeSelectAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPRvcCleanModeAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23049,8 +22945,8 @@ void CHIPRvcCleanModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23717,9 +23613,9 @@ void CHIPRefrigeratorAlarmAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectSupportedModesAttributeCallback::CHIPDishwasherModeSelectSupportedModesAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeSupportedModesAttributeCallback::CHIPDishwasherModeSupportedModesAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -23736,7 +23632,7 @@ CHIPDishwasherModeSelectSupportedModesAttributeCallback::CHIPDishwasherModeSelec } } -CHIPDishwasherModeSelectSupportedModesAttributeCallback::~CHIPDishwasherModeSelectSupportedModesAttributeCallback() +CHIPDishwasherModeSupportedModesAttributeCallback::~CHIPDishwasherModeSupportedModesAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23747,10 +23643,9 @@ CHIPDishwasherModeSelectSupportedModesAttributeCallback::~CHIPDishwasherModeSele env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( +void CHIPDishwasherModeSupportedModesAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23759,8 +23654,8 @@ void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23814,53 +23709,41 @@ void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( std::string newElement_2_valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( newElement_2_valueClassName.c_str(), newElement_2_valueCtorSignature.c_str(), entry_2.value, newElement_2_value); - jobject newElement_2_tagName; - if (!entry_2.tagName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_tagName); - } - else - { - jobject newElement_2_tagNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.tagName.Value(), - newElement_2_tagNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_tagNameInsideOptional, newElement_2_tagName); - } jclass modeTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", modeTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); return; } - jmethodID modeTagStructStructCtor_3 = env->GetMethodID( - modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;)V"); + jmethodID modeTagStructStructCtor_3 = + env->GetMethodID(modeTagStructStructClass_3, "", "(Ljava/util/Optional;Ljava/lang/Integer;)V"); if (modeTagStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); return; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value, newElement_2_tagName); + newElement_2 = + env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, newElement_2_value); chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); } jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeSelectClusterModeOptionStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); return; } jmethodID modeOptionStructStructCtor_1 = env->GetMethodID(modeOptionStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V"); if (modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeSelectClusterModeOptionStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); return; } @@ -23873,9 +23756,9 @@ void CHIPDishwasherModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectStartUpModeAttributeCallback::CHIPDishwasherModeSelectStartUpModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeStartUpModeAttributeCallback::CHIPDishwasherModeStartUpModeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -23892,7 +23775,7 @@ CHIPDishwasherModeSelectStartUpModeAttributeCallback::CHIPDishwasherModeSelectSt } } -CHIPDishwasherModeSelectStartUpModeAttributeCallback::~CHIPDishwasherModeSelectStartUpModeAttributeCallback() +CHIPDishwasherModeStartUpModeAttributeCallback::~CHIPDishwasherModeStartUpModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23903,8 +23786,8 @@ CHIPDishwasherModeSelectStartUpModeAttributeCallback::~CHIPDishwasherModeSelectS env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPDishwasherModeStartUpModeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23912,8 +23795,8 @@ void CHIPDishwasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * con jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -23940,10 +23823,8 @@ void CHIPDishwasherModeSelectStartUpModeAttributeCallback::CallbackFn(void * con env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPDishwasherModeSelectOnModeAttributeCallback::CHIPDishwasherModeSelectOnModeAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPDishwasherModeOnModeAttributeCallback::CHIPDishwasherModeOnModeAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23959,7 +23840,7 @@ CHIPDishwasherModeSelectOnModeAttributeCallback::CHIPDishwasherModeSelectOnModeA } } -CHIPDishwasherModeSelectOnModeAttributeCallback::~CHIPDishwasherModeSelectOnModeAttributeCallback() +CHIPDishwasherModeOnModeAttributeCallback::~CHIPDishwasherModeOnModeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -23970,8 +23851,7 @@ CHIPDishwasherModeSelectOnModeAttributeCallback::~CHIPDishwasherModeSelectOnMode env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPDishwasherModeOnModeAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -23979,8 +23859,8 @@ void CHIPDishwasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24007,9 +23887,9 @@ void CHIPDishwasherModeSelectOnModeAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback( +CHIPDishwasherModeGeneratedCommandListAttributeCallback::CHIPDishwasherModeGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -24026,7 +23906,7 @@ CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CHIPDishwasherMod } } -CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::~CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback() +CHIPDishwasherModeGeneratedCommandListAttributeCallback::~CHIPDishwasherModeGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24037,7 +23917,7 @@ CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::~CHIPDishwasherMo env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPDishwasherModeGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -24047,8 +23927,8 @@ void CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24078,9 +23958,9 @@ void CHIPDishwasherModeSelectGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeAcceptedCommandListAttributeCallback::CHIPDishwasherModeAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -24097,7 +23977,7 @@ CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CHIPDishwasherMode } } -CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::~CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback() +CHIPDishwasherModeAcceptedCommandListAttributeCallback::~CHIPDishwasherModeAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24108,7 +23988,7 @@ CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::~CHIPDishwasherMod env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPDishwasherModeAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -24118,8 +23998,8 @@ void CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24149,10 +24029,8 @@ void CHIPDishwasherModeSelectAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectEventListAttributeCallback::CHIPDishwasherModeSelectEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPDishwasherModeEventListAttributeCallback::CHIPDishwasherModeEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24168,7 +24046,7 @@ CHIPDishwasherModeSelectEventListAttributeCallback::CHIPDishwasherModeSelectEven } } -CHIPDishwasherModeSelectEventListAttributeCallback::~CHIPDishwasherModeSelectEventListAttributeCallback() +CHIPDishwasherModeEventListAttributeCallback::~CHIPDishwasherModeEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24179,8 +24057,8 @@ CHIPDishwasherModeSelectEventListAttributeCallback::~CHIPDishwasherModeSelectEve env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPDishwasherModeEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -24189,8 +24067,8 @@ void CHIPDishwasherModeSelectEventListAttributeCallback::CallbackFn(void * conte VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -24220,9 +24098,9 @@ void CHIPDishwasherModeSelectEventListAttributeCallback::CallbackFn(void * conte env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDishwasherModeSelectAttributeListAttributeCallback::CHIPDishwasherModeSelectAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPDishwasherModeAttributeListAttributeCallback::CHIPDishwasherModeAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -24239,7 +24117,7 @@ CHIPDishwasherModeSelectAttributeListAttributeCallback::CHIPDishwasherModeSelect } } -CHIPDishwasherModeSelectAttributeListAttributeCallback::~CHIPDishwasherModeSelectAttributeListAttributeCallback() +CHIPDishwasherModeAttributeListAttributeCallback::~CHIPDishwasherModeAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -24250,7 +24128,7 @@ CHIPDishwasherModeSelectAttributeListAttributeCallback::~CHIPDishwasherModeSelec env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDishwasherModeSelectAttributeListAttributeCallback::CallbackFn( +void CHIPDishwasherModeAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -24260,8 +24138,8 @@ void CHIPDishwasherModeSelectAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 0dcded17ad2c69..23ca8d6a4308bf 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -13420,29 +13420,9 @@ public void changeToMode(DefaultClusterCallback callback , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - public interface ChangeToModeResponseCallback { - void onSuccess(Integer status, Optional statusText); - - void onError(Exception error); - } - public interface StandardNamespaceAttributeCallback { void onSuccess(@Nullable Integer value); @@ -13732,41 +13712,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class LaundryWasherModeSelectCluster extends BaseChipCluster { + public static class LaundryWasherModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 81L; - public LaundryWasherModeSelectCluster(long devicePtr, int endpointId) { + public LaundryWasherModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -13777,7 +13743,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -13812,18 +13778,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -13958,13 +13912,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -14040,41 +13987,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RefrigeratorAndTemperatureControlledCabinetModeSelectCluster extends BaseChipCluster { + public static class RefrigeratorAndTemperatureControlledCabinetModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 82L; - public RefrigeratorAndTemperatureControlledCabinetModeSelectCluster(long devicePtr, int endpointId) { + public RefrigeratorAndTemperatureControlledCabinetModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -14085,7 +14018,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -14120,18 +14053,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -14266,13 +14187,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -14603,41 +14517,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RvcRunModeSelectCluster extends BaseChipCluster { + public static class RvcRunModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 84L; - public RvcRunModeSelectCluster(long devicePtr, int endpointId) { + public RvcRunModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -14648,7 +14548,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -14683,18 +14583,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -14829,13 +14717,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -14911,41 +14792,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class RvcCleanModeSelectCluster extends BaseChipCluster { + public static class RvcCleanModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 85L; - public RvcCleanModeSelectCluster(long devicePtr, int endpointId) { + public RvcCleanModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -14956,7 +14823,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -14991,18 +14858,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -15137,13 +14992,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); @@ -15668,41 +15516,27 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, , int minInterval, int maxInterval); } - public static class DishwasherModeSelectCluster extends BaseChipCluster { + public static class DishwasherModeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 89L; - public DishwasherModeSelectCluster(long devicePtr, int endpointId) { + public DishwasherModeCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode) { changeToMode(chipClusterPtr, callback, newMode, null); } - public void changeToMode(DefaultClusterCallback callback + public void changeToMode(ChangeToModeResponseCallback callback , Integer newMode , int timedInvokeTimeoutMs) { changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, null); - } - - public void changeToModeWithStatus(ChangeToModeResponseCallback callback - , Integer newMode - , int timedInvokeTimeoutMs) { - changeToModeWithStatus(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs); - } - private native void changeToMode(long chipClusterPtr, DefaultClusterCallback Callback - , Integer newMode - , @Nullable Integer timedInvokeTimeoutMs); - private native void changeToModeWithStatus(long chipClusterPtr, ChangeToModeResponseCallback Callback + private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback Callback , Integer newMode , @Nullable Integer timedInvokeTimeoutMs); public interface ChangeToModeResponseCallback { @@ -15713,7 +15547,7 @@ public interface ChangeToModeResponseCallback { public interface SupportedModesAttributeCallback { - void onSuccess( List valueList); + void onSuccess( List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -15748,18 +15582,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readDescriptionAttribute( - CharStringAttributeCallback callback - ) { - readDescriptionAttribute(chipClusterPtr, callback); - } - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback -, - int minInterval, int maxInterval) { - subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readSupportedModesAttribute( SupportedModesAttributeCallback callback ) { @@ -15894,13 +15716,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback - ); - private native void subscribeDescriptionAttribute(long chipClusterPtr, - CharStringAttributeCallback callback -, int minInterval, int maxInterval); - private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback ); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index c00922da385d68..77bdd9bce58781 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -151,19 +151,19 @@ public static String clusterIdToName(long clusterId) { return "ModeSelect"; } if (clusterId == 81L) { - return "LaundryWasherModeSelect"; + return "LaundryWasherMode"; } if (clusterId == 82L) { - return "RefrigeratorAndTemperatureControlledCabinetModeSelect"; + return "RefrigeratorAndTemperatureControlledCabinetMode"; } if (clusterId == 83L) { return "WasherControls"; } if (clusterId == 84L) { - return "RvcRunModeSelect"; + return "RvcRunMode"; } if (clusterId == 85L) { - return "RvcCleanModeSelect"; + return "RvcCleanMode"; } if (clusterId == 86L) { return "TemperatureControl"; @@ -172,7 +172,7 @@ public static String clusterIdToName(long clusterId) { return "RefrigeratorAlarm"; } if (clusterId == 89L) { - return "DishwasherModeSelect"; + return "DishwasherMode"; } if (clusterId == 91L) { return "AirQuality"; @@ -2176,18 +2176,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 81L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2212,18 +2209,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 82L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2281,18 +2275,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 84L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2317,18 +2308,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 85L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { @@ -2419,18 +2407,15 @@ public static String attributeIdToName(long clusterId, long attributeId) { } if (clusterId == 89L) { if (attributeId == 0L) { - return "Description"; - } - if (attributeId == 2L) { return "SupportedModes"; } - if (attributeId == 3L) { + if (attributeId == 1L) { return "CurrentMode"; } - if (attributeId == 4L) { + if (attributeId == 2L) { return "StartUpMode"; } - if (attributeId == 5L) { + if (attributeId == 3L) { return "OnMode"; } if (attributeId == 65528L) { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index c6a21a366ae154..b024e13325d2b8 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1542,34 +1542,28 @@ public String toString() { } } -public static class ModeSelectClusterModeTagStruct { -public Optional mfgCode; +public static class ModeSelectClusterSemanticTagStruct { +public Integer mfgCode; public Integer value; -public Optional tagName; - public ModeSelectClusterModeTagStruct( - Optional mfgCode + public ModeSelectClusterSemanticTagStruct( + Integer mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ModeSelectClusterModeTagStruct {\n"); + output.append("ModeSelectClusterSemanticTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } @@ -1578,16 +1572,16 @@ public String toString() { public static class ModeSelectClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList semanticTags; public ModeSelectClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList semanticTags ) { this.label = label; this.mode = mode; - this.modeTags = modeTags; + this.semanticTags = semanticTags; } @Override @@ -1600,56 +1594,50 @@ public String toString() { output.append("\tmode: "); output.append(mode); output.append("\n"); - output.append("\tmodeTags: "); - output.append(modeTags); + output.append("\tsemanticTags: "); + output.append(semanticTags); output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class LaundryWasherModeSelectClusterModeTagStruct { +public static class LaundryWasherModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public LaundryWasherModeSelectClusterModeTagStruct( + public LaundryWasherModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("LaundryWasherModeSelectClusterModeTagStruct {\n"); + output.append("LaundryWasherModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class LaundryWasherModeSelectClusterModeOptionStruct { +public static class LaundryWasherModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public LaundryWasherModeSelectClusterModeOptionStruct( + public LaundryWasherModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1659,7 +1647,7 @@ public LaundryWasherModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("LaundryWasherModeSelectClusterModeOptionStruct {\n"); + output.append("LaundryWasherModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1674,48 +1662,42 @@ public String toString() { } } -public static class RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct { +public static class RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct( + public RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeTagStruct {\n"); + output.append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct { +public static class RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct( + public RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1725,7 +1707,7 @@ public RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStr @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RefrigeratorAndTemperatureControlledCabinetModeSelectClusterModeOptionStruct {\n"); + output.append("RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1740,48 +1722,42 @@ public String toString() { } } -public static class RvcRunModeSelectClusterModeTagStruct { +public static class RvcRunModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public RvcRunModeSelectClusterModeTagStruct( + public RvcRunModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcRunModeSelectClusterModeTagStruct {\n"); + output.append("RvcRunModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class RvcRunModeSelectClusterModeOptionStruct { +public static class RvcRunModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public RvcRunModeSelectClusterModeOptionStruct( + public RvcRunModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1791,7 +1767,7 @@ public RvcRunModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcRunModeSelectClusterModeOptionStruct {\n"); + output.append("RvcRunModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1806,48 +1782,42 @@ public String toString() { } } -public static class RvcCleanModeSelectClusterModeTagStruct { +public static class RvcCleanModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public RvcCleanModeSelectClusterModeTagStruct( + public RvcCleanModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcCleanModeSelectClusterModeTagStruct {\n"); + output.append("RvcCleanModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class RvcCleanModeSelectClusterModeOptionStruct { +public static class RvcCleanModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public RvcCleanModeSelectClusterModeOptionStruct( + public RvcCleanModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1857,7 +1827,7 @@ public RvcCleanModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("RvcCleanModeSelectClusterModeOptionStruct {\n"); + output.append("RvcCleanModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); @@ -1872,48 +1842,42 @@ public String toString() { } } -public static class DishwasherModeSelectClusterModeTagStruct { +public static class DishwasherModeClusterModeTagStruct { public Optional mfgCode; public Integer value; -public Optional tagName; - public DishwasherModeSelectClusterModeTagStruct( + public DishwasherModeClusterModeTagStruct( Optional mfgCode , Integer value - , Optional tagName ) { this.mfgCode = mfgCode; this.value = value; - this.tagName = tagName; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("DishwasherModeSelectClusterModeTagStruct {\n"); + output.append("DishwasherModeClusterModeTagStruct {\n"); output.append("\tmfgCode: "); output.append(mfgCode); output.append("\n"); output.append("\tvalue: "); output.append(value); output.append("\n"); - output.append("\ttagName: "); - output.append(tagName); - output.append("\n"); output.append("}\n"); return output.toString(); } } -public static class DishwasherModeSelectClusterModeOptionStruct { +public static class DishwasherModeClusterModeOptionStruct { public String label; public Integer mode; -public ArrayList modeTags; +public ArrayList modeTags; - public DishwasherModeSelectClusterModeOptionStruct( + public DishwasherModeClusterModeOptionStruct( String label , Integer mode - , ArrayList modeTags + , ArrayList modeTags ) { this.label = label; this.mode = mode; @@ -1923,7 +1887,7 @@ public DishwasherModeSelectClusterModeOptionStruct( @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("DishwasherModeSelectClusterModeOptionStruct {\n"); + output.append("DishwasherModeClusterModeOptionStruct {\n"); output.append("\tlabel: "); output.append(label); output.append("\n"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 906e035ca7cdb4..3db9f1bd3dba72 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -5757,29 +5757,6 @@ public void onError(Exception ex) { } } - public static class DelegatedModeSelectClusterChangeToModeResponseCallback implements ChipClusters.ModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer Status, Optional StatusText) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo StatusResponseValue = new CommandResponseInfo("Status", "Integer"); - responseValues.put(StatusResponseValue, Status); - CommandResponseInfo StatusTextResponseValue = new CommandResponseInfo("StatusText", "Optional"); - responseValues.put(StatusTextResponseValue, StatusText); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - public static class DelegatedModeSelectClusterStandardNamespaceAttributeCallback implements ChipClusters.ModeSelectCluster.StandardNamespaceAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -5933,7 +5910,7 @@ public void onError(Exception ex) { } } - public static class DelegatedLaundryWasherModeSelectClusterChangeToModeResponseCallback implements ChipClusters.LaundryWasherModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterChangeToModeResponseCallback implements ChipClusters.LaundryWasherModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -5956,7 +5933,7 @@ public void onError(Exception error) { } } - public static class DelegatedLaundryWasherModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterSupportedModesAttributeCallback implements ChipClusters.LaundryWasherModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -5964,9 +5941,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5975,7 +5952,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterStartUpModeAttributeCallback implements ChipClusters.LaundryWasherModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -5994,7 +5971,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterOnModeAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterOnModeAttributeCallback implements ChipClusters.LaundryWasherModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6013,7 +5990,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6032,7 +6009,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6051,7 +6028,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterEventListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterEventListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6070,7 +6047,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedLaundryWasherModeSelectClusterAttributeListAttributeCallback implements ChipClusters.LaundryWasherModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedLaundryWasherModeClusterAttributeListAttributeCallback implements ChipClusters.LaundryWasherModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6090,7 +6067,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6113,7 +6090,7 @@ public void onError(Exception error) { } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterSupportedModesAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6121,9 +6098,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6132,7 +6109,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterStartUpModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6151,7 +6128,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterOnModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterOnModeAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6170,7 +6147,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6189,7 +6166,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6208,7 +6185,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterEventListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterEventListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6227,7 +6204,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterAttributeListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterAttributeListAttributeCallback implements ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6381,7 +6358,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRvcRunModeSelectClusterChangeToModeResponseCallback implements ChipClusters.RvcRunModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterChangeToModeResponseCallback implements ChipClusters.RvcRunModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6404,7 +6381,7 @@ public void onError(Exception error) { } } - public static class DelegatedRvcRunModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterSupportedModesAttributeCallback implements ChipClusters.RvcRunModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6412,9 +6389,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6423,7 +6400,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterStartUpModeAttributeCallback implements ChipClusters.RvcRunModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6442,7 +6419,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterOnModeAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterOnModeAttributeCallback implements ChipClusters.RvcRunModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6461,7 +6438,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcRunModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6480,7 +6457,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcRunModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6499,7 +6476,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterEventListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterEventListAttributeCallback implements ChipClusters.RvcRunModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6518,7 +6495,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcRunModeSelectClusterAttributeListAttributeCallback implements ChipClusters.RvcRunModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcRunModeClusterAttributeListAttributeCallback implements ChipClusters.RvcRunModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6538,7 +6515,7 @@ public void onError(Exception ex) { } } - public static class DelegatedRvcCleanModeSelectClusterChangeToModeResponseCallback implements ChipClusters.RvcCleanModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterChangeToModeResponseCallback implements ChipClusters.RvcCleanModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6561,7 +6538,7 @@ public void onError(Exception error) { } } - public static class DelegatedRvcCleanModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterSupportedModesAttributeCallback implements ChipClusters.RvcCleanModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6569,9 +6546,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6580,7 +6557,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterStartUpModeAttributeCallback implements ChipClusters.RvcCleanModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6599,7 +6576,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterOnModeAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterOnModeAttributeCallback implements ChipClusters.RvcCleanModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6618,7 +6595,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.RvcCleanModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6637,7 +6614,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.RvcCleanModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6656,7 +6633,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterEventListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterEventListAttributeCallback implements ChipClusters.RvcCleanModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6675,7 +6652,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedRvcCleanModeSelectClusterAttributeListAttributeCallback implements ChipClusters.RvcCleanModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedRvcCleanModeClusterAttributeListAttributeCallback implements ChipClusters.RvcCleanModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6868,7 +6845,7 @@ public void onError(Exception ex) { } } - public static class DelegatedDishwasherModeSelectClusterChangeToModeResponseCallback implements ChipClusters.DishwasherModeSelectCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterChangeToModeResponseCallback implements ChipClusters.DishwasherModeCluster.ChangeToModeResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6891,7 +6868,7 @@ public void onError(Exception error) { } } - public static class DelegatedDishwasherModeSelectClusterSupportedModesAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterSupportedModesAttributeCallback implements ChipClusters.DishwasherModeCluster.SupportedModesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6899,9 +6876,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6910,7 +6887,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterStartUpModeAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterStartUpModeAttributeCallback implements ChipClusters.DishwasherModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6929,7 +6906,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterOnModeAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.OnModeAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterOnModeAttributeCallback implements ChipClusters.DishwasherModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6948,7 +6925,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterGeneratedCommandListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.DishwasherModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6967,7 +6944,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterAcceptedCommandListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterAcceptedCommandListAttributeCallback implements ChipClusters.DishwasherModeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -6986,7 +6963,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterEventListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterEventListAttributeCallback implements ChipClusters.DishwasherModeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -7005,7 +6982,7 @@ public void onError(Exception ex) { callback.onFailure(ex); } } - public static class DelegatedDishwasherModeSelectClusterAttributeListAttributeCallback implements ChipClusters.DishwasherModeSelectCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedDishwasherModeClusterAttributeListAttributeCallback implements ChipClusters.DishwasherModeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -19993,30 +19970,30 @@ public Map initializeClusterMap() { ClusterInfo modeSelectClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ModeSelectCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("modeSelect", modeSelectClusterInfo); - ClusterInfo laundryWasherModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.LaundryWasherModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("laundryWasherModeSelect", laundryWasherModeSelectClusterInfo); - ClusterInfo refrigeratorAndTemperatureControlledCabinetModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("refrigeratorAndTemperatureControlledCabinetModeSelect", refrigeratorAndTemperatureControlledCabinetModeSelectClusterInfo); + ClusterInfo laundryWasherModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.LaundryWasherModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("laundryWasherMode", laundryWasherModeClusterInfo); + ClusterInfo refrigeratorAndTemperatureControlledCabinetModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("refrigeratorAndTemperatureControlledCabinetMode", refrigeratorAndTemperatureControlledCabinetModeClusterInfo); ClusterInfo washerControlsClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WasherControlsCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("washerControls", washerControlsClusterInfo); - ClusterInfo rvcRunModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RvcRunModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("rvcRunModeSelect", rvcRunModeSelectClusterInfo); - ClusterInfo rvcCleanModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.RvcCleanModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("rvcCleanModeSelect", rvcCleanModeSelectClusterInfo); + ClusterInfo rvcRunModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RvcRunModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("rvcRunMode", rvcRunModeClusterInfo); + ClusterInfo rvcCleanModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.RvcCleanModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("rvcCleanMode", rvcCleanModeClusterInfo); ClusterInfo temperatureControlClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.TemperatureControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("temperatureControl", temperatureControlClusterInfo); ClusterInfo refrigeratorAlarmClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.RefrigeratorAlarmCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInfo); - ClusterInfo dishwasherModeSelectClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DishwasherModeSelectCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("dishwasherModeSelect", dishwasherModeSelectClusterInfo); + ClusterInfo dishwasherModeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DishwasherModeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("dishwasherMode", dishwasherModeClusterInfo); ClusterInfo airQualityClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.AirQualityCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("airQuality", airQualityClusterInfo); @@ -20309,14 +20286,14 @@ public void combineCommand(Map destination, Map> getCommandMap() { modeSelectchangeToModeCommandParams ); modeSelectClusterInteractionInfoMap.put("changeToMode", modeSelectchangeToModeInteractionInfo); - Map modeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo modeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - modeSelectchangeToModeWithStatusCommandParams.put("newMode",modeSelectchangeToModeWithStatusnewModeCommandParameterInfo); - - InteractionInfo modeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.ModeSelectCluster.ChangeToModeResponseCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedModeSelectClusterChangeToModeResponseCallback(), - modeSelectchangeToModeWithStatusCommandParams - ); - modeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", modeSelectchangeToModeWithStatusInteractionInfo); commandMap.put("modeSelect", modeSelectClusterInteractionInfoMap); - Map laundryWasherModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map laundryWasherModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - laundryWasherModeSelectchangeToModeCommandParams.put("newMode",laundryWasherModeSelectchangeToModenewModeCommandParameterInfo); + Map laundryWasherModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map laundryWasherModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo laundryWasherModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + laundryWasherModechangeToModeCommandParams.put("newMode",laundryWasherModechangeToModenewModeCommandParameterInfo); - InteractionInfo laundryWasherModeSelectchangeToModeInteractionInfo = new InteractionInfo( + InteractionInfo laundryWasherModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback + ((ChipClusters.LaundryWasherModeCluster) cluster) + .changeToMode((ChipClusters.LaundryWasherModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedDefaultClusterCallback(), - laundryWasherModeSelectchangeToModeCommandParams + () -> new DelegatedLaundryWasherModeClusterChangeToModeResponseCallback(), + laundryWasherModechangeToModeCommandParams ); - laundryWasherModeSelectClusterInteractionInfoMap.put("changeToMode", laundryWasherModeSelectchangeToModeInteractionInfo); - Map laundryWasherModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo laundryWasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - laundryWasherModeSelectchangeToModeWithStatusCommandParams.put("newMode",laundryWasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); + laundryWasherModeClusterInteractionInfoMap.put("changeToMode", laundryWasherModechangeToModeInteractionInfo); + commandMap.put("laundryWasherMode", laundryWasherModeClusterInteractionInfoMap); + Map refrigeratorAndTemperatureControlledCabinetModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map refrigeratorAndTemperatureControlledCabinetModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + refrigeratorAndTemperatureControlledCabinetModechangeToModeCommandParams.put("newMode",refrigeratorAndTemperatureControlledCabinetModechangeToModenewModeCommandParameterInfo); - InteractionInfo laundryWasherModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + InteractionInfo refrigeratorAndTemperatureControlledCabinetModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LaundryWasherModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.LaundryWasherModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster) cluster) + .changeToMode((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedLaundryWasherModeSelectClusterChangeToModeResponseCallback(), - laundryWasherModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseCallback(), + refrigeratorAndTemperatureControlledCabinetModechangeToModeCommandParams ); - laundryWasherModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", laundryWasherModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("laundryWasherModeSelect", laundryWasherModeSelectClusterInteractionInfoMap); - Map refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeCommandParams.put("newMode",refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModenewModeCommandParameterInfo); - - InteractionInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedDefaultClusterCallback(), - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeCommandParams - ); - refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap.put("changeToMode", refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeInteractionInfo); - Map refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusCommandParams.put("newMode",refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); - - InteractionInfo refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.RefrigeratorAndTemperatureControlledCabinetModeSelectCluster.ChangeToModeResponseCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeResponseCallback(), - refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusCommandParams - ); - refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", refrigeratorAndTemperatureControlledCabinetModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("refrigeratorAndTemperatureControlledCabinetModeSelect", refrigeratorAndTemperatureControlledCabinetModeSelectClusterInteractionInfoMap); + refrigeratorAndTemperatureControlledCabinetModeClusterInteractionInfoMap.put("changeToMode", refrigeratorAndTemperatureControlledCabinetModechangeToModeInteractionInfo); + commandMap.put("refrigeratorAndTemperatureControlledCabinetMode", refrigeratorAndTemperatureControlledCabinetModeClusterInteractionInfoMap); Map washerControlsClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("washerControls", washerControlsClusterInteractionInfoMap); - Map rvcRunModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map rvcRunModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcRunModeSelectchangeToModeCommandParams.put("newMode",rvcRunModeSelectchangeToModenewModeCommandParameterInfo); - - InteractionInfo rvcRunModeSelectchangeToModeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedDefaultClusterCallback(), - rvcRunModeSelectchangeToModeCommandParams - ); - rvcRunModeSelectClusterInteractionInfoMap.put("changeToMode", rvcRunModeSelectchangeToModeInteractionInfo); - Map rvcRunModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcRunModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcRunModeSelectchangeToModeWithStatusCommandParams.put("newMode",rvcRunModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); + Map rvcRunModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcRunModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcRunModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + rvcRunModechangeToModeCommandParams.put("newMode",rvcRunModechangeToModenewModeCommandParameterInfo); - InteractionInfo rvcRunModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + InteractionInfo rvcRunModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcRunModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.RvcRunModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.RvcRunModeCluster) cluster) + .changeToMode((ChipClusters.RvcRunModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedRvcRunModeSelectClusterChangeToModeResponseCallback(), - rvcRunModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRvcRunModeClusterChangeToModeResponseCallback(), + rvcRunModechangeToModeCommandParams ); - rvcRunModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", rvcRunModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("rvcRunModeSelect", rvcRunModeSelectClusterInteractionInfoMap); - Map rvcCleanModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map rvcCleanModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcCleanModeSelectchangeToModeCommandParams.put("newMode",rvcCleanModeSelectchangeToModenewModeCommandParameterInfo); + rvcRunModeClusterInteractionInfoMap.put("changeToMode", rvcRunModechangeToModeInteractionInfo); + commandMap.put("rvcRunMode", rvcRunModeClusterInteractionInfoMap); + Map rvcCleanModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map rvcCleanModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo rvcCleanModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + rvcCleanModechangeToModeCommandParams.put("newMode",rvcCleanModechangeToModenewModeCommandParameterInfo); - InteractionInfo rvcCleanModeSelectchangeToModeInteractionInfo = new InteractionInfo( + InteractionInfo rvcCleanModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedDefaultClusterCallback(), - rvcCleanModeSelectchangeToModeCommandParams - ); - rvcCleanModeSelectClusterInteractionInfoMap.put("changeToMode", rvcCleanModeSelectchangeToModeInteractionInfo); - Map rvcCleanModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo rvcCleanModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - rvcCleanModeSelectchangeToModeWithStatusCommandParams.put("newMode",rvcCleanModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); - - InteractionInfo rvcCleanModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.RvcCleanModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.RvcCleanModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.RvcCleanModeCluster) cluster) + .changeToMode((ChipClusters.RvcCleanModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedRvcCleanModeSelectClusterChangeToModeResponseCallback(), - rvcCleanModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedRvcCleanModeClusterChangeToModeResponseCallback(), + rvcCleanModechangeToModeCommandParams ); - rvcCleanModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", rvcCleanModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("rvcCleanModeSelect", rvcCleanModeSelectClusterInteractionInfoMap); + rvcCleanModeClusterInteractionInfoMap.put("changeToMode", rvcCleanModechangeToModeInteractionInfo); + commandMap.put("rvcCleanMode", rvcCleanModeClusterInteractionInfoMap); Map temperatureControlClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("temperatureControl", temperatureControlClusterInteractionInfoMap); Map refrigeratorAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("refrigeratorAlarm", refrigeratorAlarmClusterInteractionInfoMap); - Map dishwasherModeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); - Map dishwasherModeSelectchangeToModeCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectchangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - dishwasherModeSelectchangeToModeCommandParams.put("newMode",dishwasherModeSelectchangeToModenewModeCommandParameterInfo); - - InteractionInfo dishwasherModeSelectchangeToModeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster) - .changeToMode((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("newMode") - - ); - }, - () -> new DelegatedDefaultClusterCallback(), - dishwasherModeSelectchangeToModeCommandParams - ); - dishwasherModeSelectClusterInteractionInfoMap.put("changeToMode", dishwasherModeSelectchangeToModeInteractionInfo); - Map dishwasherModeSelectchangeToModeWithStatusCommandParams = new LinkedHashMap(); - CommandParameterInfo dishwasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); - dishwasherModeSelectchangeToModeWithStatusCommandParams.put("newMode",dishwasherModeSelectchangeToModeWithStatusnewModeCommandParameterInfo); + Map dishwasherModeClusterInteractionInfoMap = new LinkedHashMap<>(); + Map dishwasherModechangeToModeCommandParams = new LinkedHashMap(); + CommandParameterInfo dishwasherModechangeToModenewModeCommandParameterInfo = new CommandParameterInfo("newMode", Integer.class, Integer.class); + dishwasherModechangeToModeCommandParams.put("newMode",dishwasherModechangeToModenewModeCommandParameterInfo); - InteractionInfo dishwasherModeSelectchangeToModeWithStatusInteractionInfo = new InteractionInfo( + InteractionInfo dishwasherModechangeToModeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.DishwasherModeSelectCluster) cluster) - .changeToModeWithStatus((ChipClusters.DishwasherModeSelectCluster.ChangeToModeResponseCallback) callback + ((ChipClusters.DishwasherModeCluster) cluster) + .changeToMode((ChipClusters.DishwasherModeCluster.ChangeToModeResponseCallback) callback , (Integer) commandArguments.get("newMode") ); }, - () -> new DelegatedDishwasherModeSelectClusterChangeToModeResponseCallback(), - dishwasherModeSelectchangeToModeWithStatusCommandParams + () -> new DelegatedDishwasherModeClusterChangeToModeResponseCallback(), + dishwasherModechangeToModeCommandParams ); - dishwasherModeSelectClusterInteractionInfoMap.put("changeToModeWithStatus", dishwasherModeSelectchangeToModeWithStatusInteractionInfo); - commandMap.put("dishwasherModeSelect", dishwasherModeSelectClusterInteractionInfoMap); + dishwasherModeClusterInteractionInfoMap.put("changeToMode", dishwasherModechangeToModeInteractionInfo); + commandMap.put("dishwasherMode", dishwasherModeClusterInteractionInfoMap); Map airQualityClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("airQuality", airQualityClusterInteractionInfoMap); Map smokeCoAlarmClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 5bc1773b7ce3ce..ebcb10cbbb1287 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4279,13 +4279,6 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { @@ -4364,8 +4357,8 @@ class ChipClusters: }, }, } - _LAUNDRY_WASHER_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "LaundryWasherModeSelect", + _LAUNDRY_WASHER_MODE_CLUSTER_INFO = { + "clusterName": "LaundryWasherMode", "clusterId": 0x00000051, "commands": { 0x00000000: { @@ -4375,43 +4368,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4454,8 +4434,8 @@ class ChipClusters: }, }, } - _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "RefrigeratorAndTemperatureControlledCabinetModeSelect", + _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_INFO = { + "clusterName": "RefrigeratorAndTemperatureControlledCabinetMode", "clusterId": 0x00000052, "commands": { 0x00000000: { @@ -4465,43 +4445,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4614,8 +4581,8 @@ class ChipClusters: }, }, } - _RVC_RUN_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "RvcRunModeSelect", + _RVC_RUN_MODE_CLUSTER_INFO = { + "clusterName": "RvcRunMode", "clusterId": 0x00000054, "commands": { 0x00000000: { @@ -4625,43 +4592,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4704,8 +4658,8 @@ class ChipClusters: }, }, } - _RVC_CLEAN_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "RvcCleanModeSelect", + _RVC_CLEAN_MODE_CLUSTER_INFO = { + "clusterName": "RvcCleanMode", "clusterId": 0x00000055, "commands": { 0x00000000: { @@ -4715,43 +4669,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -4938,8 +4879,8 @@ class ChipClusters: }, }, } - _DISHWASHER_MODE_SELECT_CLUSTER_INFO = { - "clusterName": "DishwasherModeSelect", + _DISHWASHER_MODE_CLUSTER_INFO = { + "clusterName": "DishwasherMode", "clusterId": 0x00000059, "commands": { 0x00000000: { @@ -4949,43 +4890,30 @@ class ChipClusters: "newMode": "int", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeToModeWithStatus", - "args": { - "newMode": "int", - }, - }, }, "attributes": { 0x00000000: { - "attributeName": "Description", - "attributeId": 0x00000000, - "type": "str", - "reportable": True, - }, - 0x00000002: { "attributeName": "SupportedModes", - "attributeId": 0x00000002, + "attributeId": 0x00000000, "type": "", "reportable": True, }, - 0x00000003: { + 0x00000001: { "attributeName": "CurrentMode", - "attributeId": 0x00000003, + "attributeId": 0x00000001, "type": "int", "reportable": True, }, - 0x00000004: { + 0x00000002: { "attributeName": "StartUpMode", - "attributeId": 0x00000004, + "attributeId": 0x00000002, "type": "int", "reportable": True, "writable": True, }, - 0x00000005: { + 0x00000003: { "attributeName": "OnMode", - "attributeId": 0x00000005, + "attributeId": 0x00000003, "type": "int", "reportable": True, "writable": True, @@ -15684,14 +15612,14 @@ class ChipClusters: 0x00000045: _BOOLEAN_STATE_CLUSTER_INFO, 0x00000046: _ICD_MANAGEMENT_CLUSTER_INFO, 0x00000050: _MODE_SELECT_CLUSTER_INFO, - 0x00000051: _LAUNDRY_WASHER_MODE_SELECT_CLUSTER_INFO, - 0x00000052: _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_INFO, + 0x00000051: _LAUNDRY_WASHER_MODE_CLUSTER_INFO, + 0x00000052: _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_INFO, 0x00000053: _WASHER_CONTROLS_CLUSTER_INFO, - 0x00000054: _RVC_RUN_MODE_SELECT_CLUSTER_INFO, - 0x00000055: _RVC_CLEAN_MODE_SELECT_CLUSTER_INFO, + 0x00000054: _RVC_RUN_MODE_CLUSTER_INFO, + 0x00000055: _RVC_CLEAN_MODE_CLUSTER_INFO, 0x00000056: _TEMPERATURE_CONTROL_CLUSTER_INFO, 0x00000057: _REFRIGERATOR_ALARM_CLUSTER_INFO, - 0x00000059: _DISHWASHER_MODE_SELECT_CLUSTER_INFO, + 0x00000059: _DISHWASHER_MODE_CLUSTER_INFO, 0x0000005B: _AIR_QUALITY_CLUSTER_INFO, 0x0000005C: _SMOKE_CO_ALARM_CLUSTER_INFO, 0x00000060: _OPERATIONAL_STATE_CLUSTER_INFO, @@ -15819,14 +15747,14 @@ class ChipClusters: "BooleanState": _BOOLEAN_STATE_CLUSTER_INFO, "IcdManagement": _ICD_MANAGEMENT_CLUSTER_INFO, "ModeSelect": _MODE_SELECT_CLUSTER_INFO, - "LaundryWasherModeSelect": _LAUNDRY_WASHER_MODE_SELECT_CLUSTER_INFO, - "RefrigeratorAndTemperatureControlledCabinetModeSelect": _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_INFO, + "LaundryWasherMode": _LAUNDRY_WASHER_MODE_CLUSTER_INFO, + "RefrigeratorAndTemperatureControlledCabinetMode": _REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_INFO, "WasherControls": _WASHER_CONTROLS_CLUSTER_INFO, - "RvcRunModeSelect": _RVC_RUN_MODE_SELECT_CLUSTER_INFO, - "RvcCleanModeSelect": _RVC_CLEAN_MODE_SELECT_CLUSTER_INFO, + "RvcRunMode": _RVC_RUN_MODE_CLUSTER_INFO, + "RvcCleanMode": _RVC_CLEAN_MODE_CLUSTER_INFO, "TemperatureControl": _TEMPERATURE_CONTROL_CLUSTER_INFO, "RefrigeratorAlarm": _REFRIGERATOR_ALARM_CLUSTER_INFO, - "DishwasherModeSelect": _DISHWASHER_MODE_SELECT_CLUSTER_INFO, + "DishwasherMode": _DISHWASHER_MODE_CLUSTER_INFO, "AirQuality": _AIR_QUALITY_CLUSTER_INFO, "SmokeCoAlarm": _SMOKE_CO_ALARM_CLUSTER_INFO, "OperationalState": _OPERATIONAL_STATE_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index d80b6b3b254ce5..da33a4a753e694 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -14869,7 +14869,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="standardNamespace", Tag=0x00000001, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="standardNamespace", Tag=0x00000001, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[ModeSelect.Structs.ModeOptionStruct]), ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), @@ -14883,7 +14883,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) description: 'str' = None - standardNamespace: 'typing.Union[None, Nullable, uint]' = None + standardNamespace: 'typing.Union[Nullable, uint]' = None supportedModes: 'typing.List[ModeSelect.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None @@ -14895,54 +14895,23 @@ def descriptor(cls) -> ClusterObjectDescriptor: featureMap: 'uint' = None clusterRevision: 'uint' = None - class Enums: - class ModeTag(MatterIntEnum): - kAuto = 0x00 - kQuick = 0x01 - kQuiet = 0x02 - kLowNoise = 0x03 - kLowEnergy = 0x04 - kVacation = 0x05 - kMin = 0x06 - kMax = 0x07 - kNight = 0x08 - kDay = 0x09 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 10, - - class StatusCode(MatterIntEnum): - kSuccess = 0x00 - kUnsupportedMode = 0x01 - kGenericFailure = 0x02 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving and unknown - # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, - class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass - class ModeTagStruct(ClusterObject): + class SemanticTagStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) - mfgCode: 'typing.Optional[uint]' = None + mfgCode: 'uint' = 0 value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -14952,12 +14921,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[ModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="semanticTags", Tag=2, Type=typing.List[ModeSelect.Structs.SemanticTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[ModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + semanticTags: 'typing.List[ModeSelect.Structs.SemanticTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -14976,40 +14945,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: newMode: 'uint' = 0 - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0050 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = 'ChangeToModeResponse' - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0050 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="statusText", Tag=1, Type=typing.Optional[str]), - ]) - - status: 'uint' = 0 - statusText: 'typing.Optional[str]' = None - class Attributes: @dataclass class Description(ClusterAttributeDescriptor): @@ -15039,9 +14974,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) - value: 'typing.Union[None, Nullable, uint]' = None + value: 'typing.Union[Nullable, uint]' = NullValue @dataclass class SupportedModes(ClusterAttributeDescriptor): @@ -15205,18 +15140,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class LaundryWasherModeSelect(Cluster): +class LaundryWasherMode(Cluster): id: typing.ClassVar[int] = 0x0051 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[LaundryWasherMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -15225,8 +15159,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[LaundryWasherMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -15252,7 +15185,6 @@ class ModeTag(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -15263,12 +15195,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -15278,12 +15208,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[LaundryWasherModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[LaundryWasherMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[LaundryWasherModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[LaundryWasherMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -15291,22 +15221,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0051 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0051 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -15321,7 +15235,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0051 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -15337,22 +15251,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0051 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -15361,13 +15259,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[LaundryWasherMode.Structs.ModeOptionStruct]) - value: 'typing.List[LaundryWasherModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[LaundryWasherMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -15377,7 +15275,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15393,7 +15291,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15409,7 +15307,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15515,18 +15413,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RefrigeratorAndTemperatureControlledCabinetModeSelect(Cluster): +class RefrigeratorAndTemperatureControlledCabinetMode(Cluster): id: typing.ClassVar[int] = 0x0052 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -15535,8 +15432,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -15560,7 +15456,6 @@ class ModeTag(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -15571,12 +15466,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -15586,12 +15479,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -15599,22 +15492,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0052 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0052 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -15629,7 +15506,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0052 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -15645,22 +15522,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0052 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -15669,13 +15530,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]) - value: 'typing.List[RefrigeratorAndTemperatureControlledCabinetModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RefrigeratorAndTemperatureControlledCabinetMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -15685,7 +15546,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15701,7 +15562,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -15717,7 +15578,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16021,18 +15882,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RvcRunModeSelect(Cluster): +class RvcRunMode(Cluster): id: typing.ClassVar[int] = 0x0054 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[RvcRunMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -16041,8 +15901,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[RvcRunMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -16081,7 +15940,6 @@ class StatusCode(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -16092,12 +15950,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -16107,12 +15963,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcRunModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcRunMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[RvcRunModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[RvcRunMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -16120,22 +15976,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0054 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0054 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -16150,7 +15990,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0054 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -16166,22 +16006,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0054 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -16190,13 +16014,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RvcRunMode.Structs.ModeOptionStruct]) - value: 'typing.List[RvcRunModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RvcRunMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -16206,7 +16030,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16222,7 +16046,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16238,7 +16062,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16344,18 +16168,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class RvcCleanModeSelect(Cluster): +class RvcCleanMode(Cluster): id: typing.ClassVar[int] = 0x0055 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[RvcCleanMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -16364,8 +16187,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[RvcCleanMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -16398,7 +16220,6 @@ class StatusCode(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -16409,12 +16230,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -16424,12 +16243,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcCleanModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[RvcCleanMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[RvcCleanModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[RvcCleanMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -16437,22 +16256,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0055 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0055 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -16467,7 +16270,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0055 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -16483,22 +16286,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0055 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -16507,13 +16294,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[RvcCleanMode.Structs.ModeOptionStruct]) - value: 'typing.List[RvcCleanModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[RvcCleanMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -16523,7 +16310,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16539,7 +16326,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16555,7 +16342,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -17102,18 +16889,17 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass -class DishwasherModeSelect(Cluster): +class DishwasherMode(Cluster): id: typing.ClassVar[int] = 0x0059 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="description", Tag=0x00000000, Type=str), - ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000002, Type=typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]), - ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000005, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[DishwasherMode.Structs.ModeOptionStruct]), + ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -17122,8 +16908,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - description: 'str' = None - supportedModes: 'typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]' = None + supportedModes: 'typing.List[DishwasherMode.Structs.ModeOptionStruct]' = None currentMode: 'uint' = None startUpMode: 'typing.Union[None, Nullable, uint]' = None onMode: 'typing.Union[None, Nullable, uint]' = None @@ -17148,7 +16933,6 @@ class ModeTag(MatterIntEnum): class Bitmaps: class Feature(IntFlag): kOnOff = 0x1 - kExtendedStatus = 0x2 class Structs: @dataclass @@ -17159,12 +16943,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="mfgCode", Tag=0, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="value", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="tagName", Tag=2, Type=typing.Optional[str]), ]) mfgCode: 'typing.Optional[uint]' = None value: 'uint' = 0 - tagName: 'typing.Optional[str]' = None @dataclass class ModeOptionStruct(ClusterObject): @@ -17174,12 +16956,12 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="label", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="mode", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[DishwasherModeSelect.Structs.ModeTagStruct]), + ClusterObjectFieldDescriptor(Label="modeTags", Tag=2, Type=typing.List[DishwasherMode.Structs.ModeTagStruct]), ]) label: 'str' = "" mode: 'uint' = 0 - modeTags: 'typing.List[DishwasherModeSelect.Structs.ModeTagStruct]' = field(default_factory=lambda: []) + modeTags: 'typing.List[DishwasherMode.Structs.ModeTagStruct]' = field(default_factory=lambda: []) class Commands: @dataclass @@ -17187,22 +16969,6 @@ class ChangeToMode(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0059 command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="newMode", Tag=0, Type=uint), - ]) - - newMode: 'uint' = 0 - - @dataclass - class ChangeToModeWithStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0059 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = 'ChangeToModeResponse' @ChipUtility.classproperty @@ -17217,7 +16983,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeToModeResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0059 - command_id: typing.ClassVar[int] = 0x00000002 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -17233,22 +16999,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: statusText: 'typing.Optional[str]' = None class Attributes: - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0059 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=str) - - value: 'str' = "" - @dataclass class SupportedModes(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -17257,13 +17007,13 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[DishwasherMode.Structs.ModeOptionStruct]) - value: 'typing.List[DishwasherModeSelect.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[DishwasherMode.Structs.ModeOptionStruct]' = field(default_factory=lambda: []) @dataclass class CurrentMode(ClusterAttributeDescriptor): @@ -17273,7 +17023,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000003 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -17289,7 +17039,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000004 + return 0x00000002 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -17305,7 +17055,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000005 + return 0x00000003 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h index 001c7058cdb34c..727fa01e64720d 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.h @@ -35,9 +35,4 @@ NS_ASSUME_NONNULL_BEGIN @end -API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) -MTR_NEWLY_DEPRECATED("Please use MTRModeSelectClusterModeTagStruct") -@interface MTRModeSelectClusterSemanticTagStruct : MTRModeSelectClusterModeTagStruct -@end - NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm index 77949e0c765759..d74b24b8194939 100644 --- a/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm +++ b/src/darwin/Framework/CHIP/MTRBackwardsCompatShims.mm @@ -22,6 +22,3 @@ * This file defines implementations of manual backwards-compat shims of various sorts to handle * API changes that happened. */ - -@implementation MTRModeSelectClusterSemanticTagStruct -@end diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 331b3c09ebcd15..6a797e9185dddf 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5316,6 +5316,8 @@ - ThreadMetricsStruct GeneralDiagnostics: - NetworkInterface + ModeSelect: + - SemanticTagStruct OperationalCredentials: - FabricDescriptorStruct DoorLock: @@ -5432,6 +5434,10 @@ - iPv4Addresses - iPv6Addresses - type + ModeSelect: + SemanticTagStruct: + - mfgCode + - value OperationalCredentials: FabricDescriptorStruct: - rootPublicKey @@ -6528,6 +6534,8 @@ ThreadMetricsStruct: ThreadMetrics GeneralDiagnostics: NetworkInterface: NetworkInterfaceType + ModeSelect: + SemanticTagStruct: SemanticTag OperationalCredentials: FabricDescriptorStruct: FabricDescriptor DoorLock: @@ -7515,8 +7523,6 @@ - ProductAppearanceStruct BridgedDeviceBasicInformation: - ProductAppearanceStruct - ModeSelect: - - ModeTagStruct NetworkCommissioning: - WiFiInterfaceScanResultStruct - ThreadInterfaceScanResultStruct @@ -7541,12 +7547,6 @@ ProductAppearanceStruct: - finish - primaryColor - ModeSelect: - ModeTagStruct: - - mfgCode - - value - ModeOptionStruct: - - modeTags NetworkCommissioning: WiFiInterfaceScanResultStruct: - security @@ -8278,10 +8278,6 @@ ThreadNetworkDiagnostics: - NeighborTable - RouteTable - struct fields: - ModeSelect: - ModeOptionStruct: - - semanticTags bitmaps: Groups: - GroupClusterFeature @@ -8307,8 +8303,6 @@ structs: AccessControl: AccessControlTargetStruct: Target - ModeSelect: - ModeTagStruct: SemanticTag NetworkCommissioning: WiFiInterfaceScanResultStruct: WiFiInterfaceScanResult ThreadInterfaceScanResultStruct: ThreadInterfaceScanResult @@ -8316,10 +8310,6 @@ ThreadNetworkDiagnostics: NeighborTableStruct: NeighborTable RouteTableStruct: RouteTable - struct fields: - ModeSelect: - ModeOptionStruct: - modeTags: semanticTags enum values: TimeSynchronization: TimeSourceEnum: @@ -8394,30 +8384,12 @@ - TonerCartridgeMonitoring # Not ready to be public API yet. - ICDManagement - - LaundryWasherModeSelect - - RefrigeratorAndTemperatureControlledCabinetModeSelect - - RVCRunModeSelect - - RVCCleanModeSelect - - DishwasherModeSelect + - LaundryWasherMode + - RefrigeratorAndTemperatureControlledCabinetMode + - RVCRunMode + - RVCCleanMode + - DishwasherMode - WasherControls - commands: - ModeSelect: - # Still very in-flux. - - ChangeToModeWithStatus - - ChangeToModeResponse - struct fields: - ModeSelect: - ModeTagStruct: - - tagName - enums: - ModeSelect: - # Still very in-flux. - - ModeTag - - StatusCode - bitmap values: - ModeSelect: - Feature: - - ExtendedStatus # Once we actually unmark TimeSynchronization as provisional, all these bits should go away too, and we should instead # mark things as introduced/deprecated as needed. The "ids" entries should go away, in particular. ids: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index e1d8de2a3f7709..fe3c110ea46a02 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9048,16 +9048,12 @@ static id _Nullable DecodeAttributeValueForModeSelectCluster( newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); + auto iter_2 = entry_0.semanticTags.begin(); while (iter_2.Next()) { auto & entry_2 = iter_2.GetValue(); - MTRModeSelectClusterModeTagStruct * newElement_2; - newElement_2 = [MTRModeSelectClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } + MTRModeSelectClusterSemanticTagStruct * newElement_2; + newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; [array_2 addObject:newElement_2]; } @@ -9066,7 +9062,7 @@ static id _Nullable DecodeAttributeValueForModeSelectCluster( *aError = err; return nil; } - newElement_0.modeTags = array_2; + newElement_0.semanticTags = array_2; } [array_0 addObject:newElement_0]; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 07d2e4bf1242bc..6e21a62b8e0a73 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7722,11 +7722,8 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command ChangeToMode * - * If the NewMode field doesn't match the Mode field in an entry of the SupportedModes list the server SHALL respond with an - INVALID_COMMAND status response. If the NewMode field matches the Mode field in an entry of the SupportedModes list but the device - is unable to transition as requested, the server SHALL respond with a FAILURE status response. If the NewMode field matches the - Mode field in an entry of the SupportedModes list and the device is able to transition as requested the server SHALL set the - CurrentMode attribute to the NewMode value and SHALL respond with a SUCCESS status response. + * On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL + * set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. */ - (void)changeToModeWithParams:(MTRModeSelectClusterChangeToModeParams *)params completion:(MTRStatusCompletion)completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 11ef9066138495..6314800b01a871 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -8010,16 +8010,12 @@ newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); + auto iter_2 = entry_0.semanticTags.begin(); while (iter_2.Next()) { auto & entry_2 = iter_2.GetValue(); - MTRModeSelectClusterModeTagStruct * newElement_2; - newElement_2 = [MTRModeSelectClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } + MTRModeSelectClusterSemanticTagStruct * newElement_2; + newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; [array_2 addObject:newElement_2]; } @@ -8028,7 +8024,7 @@ OnFailureFn(context, err); return; } - newElement_0.modeTags = array_2; + newElement_0.semanticTags = array_2; } [array_0 addObject:newElement_0]; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index e870b156e5c1a9..63264e74bdead1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -687,23 +687,21 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nonnull stateValue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end -MTR_NEWLY_AVAILABLE -@interface MTRModeSelectClusterModeTagStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull value MTR_NEWLY_AVAILABLE; +API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) +@interface MTRModeSelectClusterSemanticTagStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull mfgCode API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +@property (nonatomic, copy) NSNumber * _Nonnull value API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @end MTR_DEPRECATED( - "Please use MTRModeSelectClusterModeTagStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) -@interface MTRModeSelectClusterSemanticTag : MTRModeSelectClusterModeTagStruct + "Please use MTRModeSelectClusterSemanticTagStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) +@interface MTRModeSelectClusterSemanticTag : MTRModeSelectClusterSemanticTagStruct @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRModeSelectClusterModeOptionStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @property (nonatomic, copy) NSNumber * _Nonnull mode API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSArray * _Nonnull modeTags MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSArray * _Nonnull semanticTags API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - MTR_NEWLY_DEPRECATED("Please use modeTags"); +@property (nonatomic, copy) NSArray * _Nonnull semanticTags API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 39b94703e32f23..17046b2bc00ffb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2618,12 +2618,12 @@ - (NSString *)description @end -@implementation MTRModeSelectClusterModeTagStruct +@implementation MTRModeSelectClusterSemanticTagStruct - (instancetype)init { if (self = [super init]) { - _mfgCode = nil; + _mfgCode = @(0); _value = @(0); } @@ -2632,7 +2632,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRModeSelectClusterModeTagStruct alloc] init]; + auto other = [[MTRModeSelectClusterSemanticTagStruct alloc] init]; other.mfgCode = self.mfgCode; other.value = self.value; @@ -2649,7 +2649,7 @@ - (NSString *)description @end -@implementation MTRModeSelectClusterSemanticTag : MTRModeSelectClusterModeTagStruct +@implementation MTRModeSelectClusterSemanticTag : MTRModeSelectClusterSemanticTagStruct @end @implementation MTRModeSelectClusterModeOptionStruct @@ -2661,7 +2661,7 @@ - (instancetype)init _mode = @(0); - _modeTags = [NSArray array]; + _semanticTags = [NSArray array]; } return self; } @@ -2672,28 +2672,18 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.label = self.label; other.mode = self.mode; - other.modeTags = self.modeTags; + other.semanticTags = self.semanticTags; return other; } - (NSString *)description { - NSString * descriptionString = [NSString - stringWithFormat:@"<%@: label:%@; mode:%@; modeTags:%@; >", NSStringFromClass([self class]), _label, _mode, _modeTags]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: label:%@; mode:%@; semanticTags:%@; >", + NSStringFromClass([self class]), _label, _mode, _semanticTags]; return descriptionString; } -- (void)setSemanticTags:(NSArray * _Nonnull)semanticTags -{ - self.modeTags = semanticTags; -} - -- (NSArray * _Nonnull)semanticTags -{ - return self.modeTags; -} - @end @implementation MTRRefrigeratorAlarmClusterNotifyEvent diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index fbcef1126be177..e07d98eba27594 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -198,17 +198,17 @@ class ESP32Config::KeyAllocator VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "sm-mode/%x/%x", endpoint, index) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; } - static CHIP_ERROR ModeTagsCount(char * key, size_t size, uint16_t endpoint, uint16_t index) + static CHIP_ERROR SemanticTagsCount(char * key, size_t size, uint16_t endpoint, uint16_t index) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "sm-st-sz/%x/%x", endpoint, index) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; } - static CHIP_ERROR ModeTagValue(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) + static CHIP_ERROR SemanticTagValue(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "st-v/%x/%x/%x", endpoint, index, ind) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; } - static CHIP_ERROR ModeTagMfgCode(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) + static CHIP_ERROR SemanticTagMfgCode(char * key, size_t size, uint16_t endpoint, uint16_t index, uint16_t ind) { VerifyOrReturnError(key, CHIP_ERROR_INVALID_ARGUMENT); return snprintf(key, size, "st-mfg/%x/%x/%x", endpoint, index, ind) > 0 ? CHIP_NO_ERROR : CHIP_ERROR_INTERNAL; diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 247201f74622f6..ef50827f38f950 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -7234,40 +7234,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -7275,7 +7244,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7294,7 +7263,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -7306,7 +7275,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7328,7 +7297,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -7337,7 +7306,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -7359,7 +7328,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7381,7 +7350,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -7390,7 +7359,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -7412,7 +7381,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7431,7 +7400,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -7443,7 +7412,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7462,59 +7431,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::LaundryWasherMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, zclString, - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7533,7 +7469,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7545,9 +7481,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7569,7 +7505,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7579,7 +7515,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7601,9 +7537,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -7625,7 +7561,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7635,7 +7571,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7657,9 +7593,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7678,7 +7614,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7690,9 +7626,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, - readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7711,14 +7647,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, Id, writable, + return emberAfWriteAttribute(endpoint, Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -7925,40 +7861,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -7966,7 +7871,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -7985,7 +7890,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -7997,7 +7902,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8019,7 +7924,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8028,7 +7933,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8050,7 +7955,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8072,7 +7977,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8081,7 +7986,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8103,7 +8008,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8122,7 +8027,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -8134,7 +8039,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcRunMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8153,48 +8058,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcRunModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcRunMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -8202,7 +8076,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8221,7 +8095,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -8233,7 +8107,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8255,7 +8129,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8264,7 +8138,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8286,7 +8160,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8308,7 +8182,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8317,7 +8191,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8339,7 +8213,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8358,7 +8232,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -8370,7 +8244,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8389,13 +8263,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::RvcCleanModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::RvcCleanMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Attributes { @@ -8750,40 +8624,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Attributes { -namespace Description { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) -{ - uint8_t zclString[64 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 64); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) -{ - static_assert(64 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[64 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) @@ -8791,7 +8634,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8810,7 +8653,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMode @@ -8822,7 +8665,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8844,7 +8687,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8853,7 +8696,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8875,7 +8718,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (Traits::IsNullValue(temp)) { @@ -8897,7 +8740,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) @@ -8906,7 +8749,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) @@ -8928,7 +8771,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8947,7 +8790,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -8959,7 +8802,7 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, readable, sizeof(temp)); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DishwasherMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -8978,13 +8821,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DishwasherModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::DishwasherMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 07ea56af7ea851..dd71aa3fea6314 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1382,14 +1382,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1420,16 +1415,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1460,7 +1450,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -1497,14 +1487,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1535,16 +1520,11 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1575,7 +1555,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Attributes { @@ -1644,14 +1624,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Attributes { -namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); -} // namespace Description - namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); @@ -1682,7 +1657,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 634371b70db90f..8a1dc67b15eeef 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -369,21 +369,21 @@ void emberAfIcdManagementClusterInitCallback(chip::EndpointId endpoint); */ void emberAfModeSelectClusterInitCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Init +/** @brief Laundry Washer Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfLaundryWasherModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Init +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterInitCallback(chip::EndpointId endpoint); /** @brief Washer Controls Cluster Init * @@ -393,21 +393,21 @@ void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterInitCall */ void emberAfWasherControlsClusterInitCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Init +/** @brief RVC Run Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcRunModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterInitCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Init +/** @brief RVC Clean Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcCleanModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterInitCallback(chip::EndpointId endpoint); /** @brief Temperature Control Cluster Init * @@ -425,13 +425,13 @@ void emberAfTemperatureControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfRefrigeratorAlarmClusterInitCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Init +/** @brief Dishwasher Mode Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDishwasherModeSelectClusterInitCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpoint); /** @brief Air Quality Cluster Init * @@ -4329,42 +4329,42 @@ void emberAfModeSelectClusterServerTickCallback(chip::EndpointId endpoint); void emberAfModeSelectClusterClientTickCallback(chip::EndpointId endpoint); // -// Laundry Washer Mode Select Cluster +// Laundry Washer Mode Cluster // -/** @brief Laundry Washer Mode Select Cluster Server Init +/** @brief Laundry Washer Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfLaundryWasherModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Server Shutdown +/** @brief Laundry Washer Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterLaundryWasherModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterLaundryWasherModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Client Init +/** @brief Laundry Washer Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfLaundryWasherModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Server Attribute Changed +/** @brief Laundry Washer Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterLaundryWasherModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterLaundryWasherModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief Laundry Washer Mode Select Cluster Server Pre Attribute Changed +/** @brief Laundry Washer Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4373,10 +4373,11 @@ void MatterLaundryWasherModeSelectClusterServerAttributeChangedCallback(const ch * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterLaundryWasherModeSelectClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterLaundryWasherModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Laundry Washer Mode Select Cluster Client Pre Attribute Changed +/** @brief Laundry Washer Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4385,63 +4386,64 @@ chip::Protocols::InteractionModel::Status MatterLaundryWasherModeSelectClusterSe * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterLaundryWasherModeSelectClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterLaundryWasherModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Laundry Washer Mode Select Cluster Server Tick +/** @brief Laundry Washer Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfLaundryWasherModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Laundry Washer Mode Select Cluster Client Tick +/** @brief Laundry Washer Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfLaundryWasherModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfLaundryWasherModeClusterClientTickCallback(chip::EndpointId endpoint); // -// Refrigerator And Temperature Controlled Cabinet Mode Select Cluster +// Refrigerator And Temperature Controlled Cabinet Mode Cluster // -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Init +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Shutdown +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRefrigeratorAndTemperatureControlledCabinetModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Client Init +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Attribute Changed +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerAttributeChangedCallback( +void MatterRefrigeratorAndTemperatureControlledCabinetModeClusterServerAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Pre Attribute Changed +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4451,10 +4453,10 @@ void MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerAtt * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerPreAttributeChangedCallback( +MatterRefrigeratorAndTemperatureControlledCabinetModeClusterServerPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Client Pre Attribute Changed +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4464,24 +4466,24 @@ MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerPreAttri * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRefrigeratorAndTemperatureControlledCabinetModeSelectClusterClientPreAttributeChangedCallback( +MatterRefrigeratorAndTemperatureControlledCabinetModeClusterClientPreAttributeChangedCallback( const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Server Tick +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster Client Tick +/** @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterClientTickCallback(chip::EndpointId endpoint); // // Washer Controls Cluster @@ -4562,42 +4564,42 @@ void emberAfWasherControlsClusterServerTickCallback(chip::EndpointId endpoint); void emberAfWasherControlsClusterClientTickCallback(chip::EndpointId endpoint); // -// RVC Run Mode Select Cluster +// RVC Run Mode Cluster // -/** @brief RVC Run Mode Select Cluster Server Init +/** @brief RVC Run Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcRunModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Server Shutdown +/** @brief RVC Run Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRvcRunModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRvcRunModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Client Init +/** @brief RVC Run Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcRunModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Server Attribute Changed +/** @brief RVC Run Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRvcRunModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterRvcRunModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief RVC Run Mode Select Cluster Server Pre Attribute Changed +/** @brief RVC Run Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4607,10 +4609,10 @@ void MatterRvcRunModeSelectClusterServerAttributeChangedCallback(const chip::app * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRvcRunModeSelectClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +MatterRvcRunModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Run Mode Select Cluster Client Pre Attribute Changed +/** @brief RVC Run Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4620,62 +4622,62 @@ MatterRvcRunModeSelectClusterServerPreAttributeChangedCallback(const chip::app:: * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterRvcRunModeSelectClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +MatterRvcRunModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Run Mode Select Cluster Server Tick +/** @brief RVC Run Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcRunModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief RVC Run Mode Select Cluster Client Tick +/** @brief RVC Run Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcRunModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRvcRunModeClusterClientTickCallback(chip::EndpointId endpoint); // -// RVC Clean Mode Select Cluster +// RVC Clean Mode Cluster // -/** @brief RVC Clean Mode Select Cluster Server Init +/** @brief RVC Clean Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcCleanModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Server Shutdown +/** @brief RVC Clean Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterRvcCleanModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterRvcCleanModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Client Init +/** @brief RVC Clean Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfRvcCleanModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Server Attribute Changed +/** @brief RVC Clean Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterRvcCleanModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterRvcCleanModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief RVC Clean Mode Select Cluster Server Pre Attribute Changed +/** @brief RVC Clean Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4684,10 +4686,11 @@ void MatterRvcCleanModeSelectClusterServerAttributeChangedCallback(const chip::a * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRvcCleanModeSelectClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterRvcCleanModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Clean Mode Select Cluster Client Pre Attribute Changed +/** @brief RVC Clean Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4696,24 +4699,25 @@ chip::Protocols::InteractionModel::Status MatterRvcCleanModeSelectClusterServerP * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterRvcCleanModeSelectClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterRvcCleanModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief RVC Clean Mode Select Cluster Server Tick +/** @brief RVC Clean Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcCleanModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief RVC Clean Mode Select Cluster Client Tick +/** @brief RVC Clean Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfRvcCleanModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfRvcCleanModeClusterClientTickCallback(chip::EndpointId endpoint); // // Temperature Control Cluster @@ -4870,42 +4874,42 @@ void emberAfRefrigeratorAlarmClusterServerTickCallback(chip::EndpointId endpoint void emberAfRefrigeratorAlarmClusterClientTickCallback(chip::EndpointId endpoint); // -// Dishwasher Mode Select Cluster +// Dishwasher Mode Cluster // -/** @brief Dishwasher Mode Select Cluster Server Init +/** @brief Dishwasher Mode Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDishwasherModeSelectClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Server Shutdown +/** @brief Dishwasher Mode Cluster Server Shutdown * * Server Shutdown * * @param endpoint Endpoint that is being shutdown */ -void MatterDishwasherModeSelectClusterServerShutdownCallback(chip::EndpointId endpoint); +void MatterDishwasherModeClusterServerShutdownCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Client Init +/** @brief Dishwasher Mode Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDishwasherModeSelectClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Server Attribute Changed +/** @brief Dishwasher Mode Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterDishwasherModeSelectClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterDishwasherModeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief Dishwasher Mode Select Cluster Server Pre Attribute Changed +/** @brief Dishwasher Mode Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -4914,10 +4918,11 @@ void MatterDishwasherModeSelectClusterServerAttributeChangedCallback(const chip: * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterDishwasherModeSelectClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterDishwasherModeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Dishwasher Mode Select Cluster Client Pre Attribute Changed +/** @brief Dishwasher Mode Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -4926,24 +4931,25 @@ chip::Protocols::InteractionModel::Status MatterDishwasherModeSelectClusterServe * @param size Attribute size * @param value Attribute value */ -chip::Protocols::InteractionModel::Status MatterDishwasherModeSelectClusterClientPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +chip::Protocols::InteractionModel::Status +MatterDishwasherModeClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief Dishwasher Mode Select Cluster Server Tick +/** @brief Dishwasher Mode Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfDishwasherModeSelectClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief Dishwasher Mode Select Cluster Client Tick +/** @brief Dishwasher Mode Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfDishwasherModeSelectClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfDishwasherModeClusterClientTickCallback(chip::EndpointId endpoint); // // Air Quality Cluster @@ -11711,61 +11717,30 @@ bool emberAfModeSelectClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ModeSelect::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); -/** - * @brief Laundry Washer Mode Select Cluster ChangeToMode Command callback (from client) + * @brief Laundry Washer Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfLaundryWasherModeSelectClusterChangeToModeCallback( +bool emberAfLaundryWasherModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToMode::DecodableType & commandData); + const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief Laundry Washer Mode Select Cluster ChangeToModeWithStatus Command callback (from client) + * @brief Refrigerator And Temperature Controlled Cabinet Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfLaundryWasherModeSelectClusterChangeToModeWithStatusCallback( +bool emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); -/** - * @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster ChangeToMode Command callback (from client) - */ -bool emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToMode::DecodableType & + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief Refrigerator And Temperature Controlled Cabinet Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfRefrigeratorAndTemperatureControlledCabinetModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeWithStatus:: - DecodableType & commandData); -/** - * @brief RVC Run Mode Select Cluster ChangeToMode Command callback (from client) - */ -bool emberAfRvcRunModeSelectClusterChangeToModeCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToMode::DecodableType & commandData); -/** - * @brief RVC Run Mode Select Cluster ChangeToModeWithStatus Command callback (from client) - */ -bool emberAfRvcRunModeSelectClusterChangeToModeWithStatusCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); -/** - * @brief RVC Clean Mode Select Cluster ChangeToMode Command callback (from client) + * @brief RVC Run Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfRvcCleanModeSelectClusterChangeToModeCallback( +bool emberAfRvcRunModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToMode::DecodableType & commandData); + const chip::app::Clusters::RvcRunMode::Commands::ChangeToMode::DecodableType & commandData); /** - * @brief RVC Clean Mode Select Cluster ChangeToModeWithStatus Command callback (from client) + * @brief RVC Clean Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfRvcCleanModeSelectClusterChangeToModeWithStatusCallback( +bool emberAfRvcCleanModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); + const chip::app::Clusters::RvcCleanMode::Commands::ChangeToMode::DecodableType & commandData); /** * @brief Temperature Control Cluster SetTemperature Command callback (from client) */ @@ -11773,17 +11748,11 @@ bool emberAfTemperatureControlClusterSetTemperatureCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TemperatureControl::Commands::SetTemperature::DecodableType & commandData); /** - * @brief Dishwasher Mode Select Cluster ChangeToMode Command callback (from client) - */ -bool emberAfDishwasherModeSelectClusterChangeToModeCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToMode::DecodableType & commandData); -/** - * @brief Dishwasher Mode Select Cluster ChangeToModeWithStatus Command callback (from client) + * @brief Dishwasher Mode Cluster ChangeToMode Command callback (from client) */ -bool emberAfDishwasherModeSelectClusterChangeToModeWithStatusCallback( +bool emberAfDishwasherModeClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeWithStatus::DecodableType & commandData); + const chip::app::Clusters::DishwasherMode::Commands::ChangeToMode::DecodableType & commandData); /** * @brief Smoke CO Alarm Cluster SelfTestRequest Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index c46fcf136fc3ac..4db5f488faf6aa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -1237,43 +1237,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(GroupKeyManagement::Gro } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryWasherMode::ModeTag val) { - using EnumType = ModeSelect::ModeTag; - switch (val) - { - case EnumType::kAuto: - case EnumType::kQuick: - case EnumType::kQuiet: - case EnumType::kLowNoise: - case EnumType::kLowEnergy: - case EnumType::kVacation: - case EnumType::kMin: - case EnumType::kMax: - case EnumType::kNight: - case EnumType::kDay: - return val; - default: - return static_cast(10); - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(ModeSelect::StatusCode val) -{ - using EnumType = ModeSelect::StatusCode; - switch (val) - { - case EnumType::kSuccess: - case EnumType::kUnsupportedMode: - case EnumType::kGenericFailure: - return val; - default: - return static_cast(3); - } -} - -static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryWasherModeSelect::ModeTag val) -{ - using EnumType = LaundryWasherModeSelect::ModeTag; + using EnumType = LaundryWasherMode::ModeTag; switch (val) { case EnumType::kNormal: @@ -1286,9 +1252,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(LaundryWasherModeSelect } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RefrigeratorAndTemperatureControlledCabinetModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RefrigeratorAndTemperatureControlledCabinetMode::ModeTag val) { - using EnumType = RefrigeratorAndTemperatureControlledCabinetModeSelect::ModeTag; + using EnumType = RefrigeratorAndTemperatureControlledCabinetMode::ModeTag; switch (val) { case EnumType::kRapidCool: @@ -1299,9 +1265,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RefrigeratorAndTemperat } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunMode::ModeTag val) { - using EnumType = RvcRunModeSelect::ModeTag; + using EnumType = RvcRunMode::ModeTag; switch (val) { case EnumType::kIdle: @@ -1311,9 +1277,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::ModeT return static_cast(0); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::StatusCode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunMode::StatusCode val) { - using EnumType = RvcRunModeSelect::StatusCode; + using EnumType = RvcRunMode::StatusCode; switch (val) { case EnumType::kStuck: @@ -1330,9 +1296,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcRunModeSelect::Statu } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanMode::ModeTag val) { - using EnumType = RvcCleanModeSelect::ModeTag; + using EnumType = RvcCleanMode::ModeTag; switch (val) { case EnumType::kDeepClean: @@ -1343,9 +1309,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::Mod return static_cast(0); } } -static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::StatusCode val) +static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanMode::StatusCode val) { - using EnumType = RvcCleanModeSelect::StatusCode; + using EnumType = RvcCleanMode::StatusCode; switch (val) { case EnumType::kCleaningInProgress: @@ -1355,9 +1321,9 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(RvcCleanModeSelect::Sta } } -static auto __attribute__((unused)) EnsureKnownEnumValue(DishwasherModeSelect::ModeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(DishwasherMode::ModeTag val) { - using EnumType = DishwasherModeSelect::ModeTag; + using EnumType = DishwasherMode::ModeTag; switch (val) { case EnumType::kNormal: diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index b2f8e557c3ac27..121eaeae62f0ed 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1468,48 +1468,14 @@ enum class Feature : uint32_t namespace ModeSelect { -// Enum for ModeTag -enum class ModeTag : uint16_t -{ - kAuto = 0x00, - kQuick = 0x01, - kQuiet = 0x02, - kLowNoise = 0x03, - kLowEnergy = 0x04, - kVacation = 0x05, - kMin = 0x06, - kMax = 0x07, - kNight = 0x08, - kDay = 0x09, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 10, -}; - -// Enum for StatusCode -enum class StatusCode : uint8_t -{ - kSuccess = 0x00, - kUnsupportedMode = 0x01, - kGenericFailure = 0x02, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, -}; - // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1528,12 +1494,11 @@ enum class ModeTag : uint16_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1550,10 +1515,9 @@ enum class ModeTag : uint16_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { @@ -1565,7 +1529,7 @@ enum class Feature : uint32_t }; } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1600,12 +1564,11 @@ enum class StatusCode : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1634,10 +1597,9 @@ enum class StatusCode : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { @@ -1659,7 +1621,7 @@ enum class AlarmMap : uint32_t }; } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { // Enum for ModeTag enum class ModeTag : uint16_t @@ -1677,10 +1639,9 @@ enum class ModeTag : uint16_t // Bitmap for Feature enum class Feature : uint32_t { - kOnOff = 0x1, - kExtendedStatus = 0x2, + kOnOff = 0x1, }; -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 90dec009d9c8e7..d000e28af8987a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -33,7 +33,6 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMfgCode), mfgCode)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kValue), value)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kTagName), tagName)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -59,9 +58,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kValue): ReturnErrorOnFailure(DataModel::Decode(reader, value)); break; - case to_underlying(Fields::kTagName): - ReturnErrorOnFailure(DataModel::Decode(reader, tagName)); - break; default: break; } @@ -11427,15 +11423,14 @@ namespace Events {} // namespace Events } // namespace IcdManagement namespace ModeSelect { -namespace Structs {} // namespace Structs - -namespace Commands { -namespace ChangeToMode { +namespace Structs { +namespace SemanticTagStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMfgCode), mfgCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kValue), value)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11445,7 +11440,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -11454,8 +11450,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kMfgCode): + ReturnErrorOnFailure(DataModel::Decode(reader, mfgCode)); + break; + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); break; default: break; @@ -11464,15 +11463,19 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace ChangeToMode. -namespace ChangeToModeWithStatus { + +} // namespace SemanticTagStruct +namespace ModeOptionStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kLabel), label)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kMode), mode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kSemanticTags), semanticTags)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11482,7 +11485,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { if (!TLV::IsContextTag(reader.GetTag())) @@ -11491,8 +11495,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, label)); + break; + case to_underlying(Fields::kMode): + ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + break; + case to_underlying(Fields::kSemanticTags): + ReturnErrorOnFailure(DataModel::Decode(reader, semanticTags)); break; default: break; @@ -11501,16 +11511,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; } -} // namespace ChangeToModeWithStatus. -namespace ChangeToModeResponse { + +} // namespace ModeOptionStruct +} // namespace Structs + +namespace Commands { +namespace ChangeToMode { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatus), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kStatusText), statusText)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11529,11 +11543,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kStatusText): - ReturnErrorOnFailure(DataModel::Decode(reader, statusText)); + case to_underlying(Fields::kNewMode): + ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); break; default: break; @@ -11544,7 +11555,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeToModeResponse. +} // namespace ChangeToMode. } // namespace Commands namespace Attributes { @@ -11599,7 +11610,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Structs {} // namespace Structs namespace Commands { @@ -11640,43 +11651,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -11725,9 +11699,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -11768,8 +11739,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace LaundryWasherModeSelect -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +} // namespace LaundryWasherMode +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Structs {} // namespace Structs namespace Commands { @@ -11810,43 +11781,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -11895,9 +11829,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -11938,7 +11869,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Commands {} // namespace Commands @@ -11989,7 +11920,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Structs {} // namespace Structs namespace Commands { @@ -12030,43 +11961,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -12115,9 +12009,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -12158,8 +12049,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace RvcRunModeSelect -namespace RvcCleanModeSelect { +} // namespace RvcRunMode +namespace RvcCleanMode { namespace Structs {} // namespace Structs namespace Commands { @@ -12200,43 +12091,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -12285,9 +12139,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -12328,7 +12179,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Commands { @@ -12521,7 +12372,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Structs {} // namespace Structs namespace Commands { @@ -12562,43 +12413,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace ChangeToModeWithStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kNewMode), newMode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeToModeWithStatus. namespace ChangeToModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -12647,9 +12461,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); - break; case Attributes::SupportedModes::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); break; @@ -12690,7 +12501,7 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Commands {} // namespace Commands @@ -28333,28 +28144,28 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::LaundryWasherModeSelect::Id: { + case Clusters::LaundryWasherMode::Id: { switch (aCommand) { default: return false; } } - case Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { + case Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id: { switch (aCommand) { default: return false; } } - case Clusters::RvcRunModeSelect::Id: { + case Clusters::RvcRunMode::Id: { switch (aCommand) { default: return false; } } - case Clusters::RvcCleanModeSelect::Id: { + case Clusters::RvcCleanMode::Id: { switch (aCommand) { default: @@ -28368,7 +28179,7 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::DishwasherModeSelect::Id: { + case Clusters::DishwasherMode::Id: { switch (aCommand) { default: diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index f024462a19e51e..7d386143d47cf9 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -48,7 +48,6 @@ enum class Fields : uint8_t { kMfgCode = 0, kValue = 1, - kTagName = 2, }; struct Type @@ -56,7 +55,6 @@ struct Type public: Optional mfgCode; uint16_t value = static_cast(0); - Optional tagName; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14075,111 +14073,89 @@ struct TypeInfo } // namespace IcdManagement namespace ModeSelect { namespace Structs { -namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; -namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; -} // namespace Structs - -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace ChangeToMode { -struct Type; -struct DecodableType; -} // namespace ChangeToMode - -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - -namespace ChangeToModeResponse { -struct Type; -struct DecodableType; -} // namespace ChangeToModeResponse - -} // namespace Commands - -namespace Commands { -namespace ChangeToMode { +namespace SemanticTagStruct { enum class Fields : uint8_t { - kNewMode = 0, + kMfgCode = 0, + kValue = 1, }; struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + chip::VendorId mfgCode = static_cast(0); + uint16_t value = static_cast(0); - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); - using ResponseType = DataModel::NullObjectType; + static constexpr bool kIsFabricScoped = false; - static constexpr bool MustUseTimedInvoke() { return false; } + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } +using DecodableType = Type; - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToMode -namespace ChangeToModeWithStatus { +} // namespace SemanticTagStruct +namespace ModeOptionStruct { enum class Fields : uint8_t { - kNewMode = 0, + kLabel = 0, + kMode = 1, + kSemanticTags = 2, }; struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + chip::CharSpan label; + uint8_t mode = static_cast(0); + DataModel::List semanticTags; - uint8_t newMode = static_cast(0); + static constexpr bool kIsFabricScoped = false; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } }; struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + chip::CharSpan label; + uint8_t mode = static_cast(0); + DataModel::DecodableList semanticTags; - uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; }; -}; // namespace ChangeToModeWithStatus -namespace ChangeToModeResponse { + +} // namespace ModeOptionStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace ChangeToMode { +struct Type; +struct DecodableType; +} // namespace ChangeToMode + +} // namespace Commands + +namespace Commands { +namespace ChangeToMode { enum class Fields : uint8_t { - kStatus = 0, - kStatusText = 1, + kNewMode = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - uint8_t status = static_cast(0); - Optional statusText; + uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -14191,14 +14167,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - uint8_t status = static_cast(0); - Optional statusText; + uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ChangeToModeResponse +}; // namespace ChangeToMode } // namespace Commands namespace Attributes { @@ -14339,7 +14314,7 @@ struct TypeInfo }; } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -14353,11 +14328,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -14377,13 +14347,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -14392,44 +14362,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -14442,7 +14380,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14458,7 +14396,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14469,29 +14407,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; + chip::app::DataModel::DecodableList; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::Clusters::LaundryWasherMode::Structs::ModeOptionStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14503,7 +14428,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14515,7 +14440,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14527,7 +14452,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14535,37 +14460,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } }; } // namespace ClusterRevision @@ -14573,11 +14498,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LaundryWasherMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -14591,8 +14515,8 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace LaundryWasherModeSelect -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +} // namespace LaundryWasherMode +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -14606,11 +14530,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -14630,13 +14549,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -14645,45 +14564,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = - Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -14696,7 +14582,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14712,7 +14598,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -14723,30 +14609,17 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { using Type = chip::app::DataModel::List< - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::Type>; + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::Type>; using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType>; + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType>; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14758,7 +14631,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14770,7 +14643,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14782,7 +14655,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -14790,37 +14663,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } }; } // namespace ClusterRevision @@ -14828,11 +14701,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -14846,7 +14718,7 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -14958,7 +14830,7 @@ struct TypeInfo }; } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -14972,11 +14844,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -14996,13 +14863,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -15011,44 +14878,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -15061,7 +14896,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15077,7 +14912,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15088,29 +14923,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RvcRunModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15122,7 +14944,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15134,7 +14956,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15146,7 +14968,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15154,37 +14976,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } }; } // namespace ClusterRevision @@ -15192,11 +15014,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RvcRunModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcRunMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -15210,8 +15031,8 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace RvcRunModeSelect -namespace RvcCleanModeSelect { +} // namespace RvcRunMode +namespace RvcCleanMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -15225,11 +15046,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -15249,13 +15065,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -15264,44 +15080,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -15314,7 +15098,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15330,7 +15114,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15341,29 +15125,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::RvcCleanModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15375,7 +15146,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15387,7 +15158,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15399,7 +15170,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15407,37 +15178,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } }; } // namespace ClusterRevision @@ -15445,11 +15216,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::RvcCleanMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -15463,7 +15233,7 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Commands { @@ -15780,7 +15550,7 @@ struct DecodableType } // namespace Notify } // namespace Events } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Structs { namespace ModeTagStruct = Clusters::detail::Structs::ModeTagStruct; namespace ModeOptionStruct = Clusters::detail::Structs::ModeOptionStruct; @@ -15794,11 +15564,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -struct Type; -struct DecodableType; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { struct Type; struct DecodableType; @@ -15818,13 +15583,13 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -15833,44 +15598,12 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToMode::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t newMode = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace ChangeToModeWithStatus { -enum class Fields : uint8_t -{ - kNewMode = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeToModeWithStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } - - uint8_t newMode = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeToModeWithStatus namespace ChangeToModeResponse { enum class Fields : uint8_t { @@ -15883,7 +15616,7 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15899,7 +15632,7 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeToModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } uint8_t status = static_cast(0); Optional statusText; @@ -15910,29 +15643,16 @@ struct DecodableType namespace Attributes { -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 64; } -}; -} // namespace Description namespace SupportedModes { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; using DecodableType = - chip::app::DataModel::DecodableList; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::DishwasherModeSelect::Structs::ModeOptionStruct::DecodableType> &; + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15944,7 +15664,7 @@ struct TypeInfo using DecodableType = uint8_t; using DecodableArgType = uint8_t; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15956,7 +15676,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15968,7 +15688,7 @@ struct TypeInfo using DecodableType = chip::app::DataModel::Nullable; using DecodableArgType = const chip::app::DataModel::Nullable &; - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -15976,37 +15696,37 @@ struct TypeInfo namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } }; } // namespace ClusterRevision @@ -16014,11 +15734,10 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::DishwasherModeSelect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DishwasherMode::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Description::TypeInfo::DecodableType description; Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; @@ -16032,7 +15751,7 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 0e53f32c7b92c1..a20b6cd0022bff 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -2467,27 +2467,23 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2515,29 +2511,25 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2565,7 +2557,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { namespace Attributes { @@ -2613,27 +2605,23 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2661,29 +2649,25 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2711,7 +2695,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Attributes { @@ -2805,27 +2789,23 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Attributes { -namespace Description { -static constexpr AttributeId Id = 0x00000000; -} // namespace Description - namespace SupportedModes { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000000; } // namespace SupportedModes namespace CurrentMode { -static constexpr AttributeId Id = 0x00000003; +static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode namespace StartUpMode { -static constexpr AttributeId Id = 0x00000004; +static constexpr AttributeId Id = 0x00000002; } // namespace StartUpMode namespace OnMode { -static constexpr AttributeId Id = 0x00000005; +static constexpr AttributeId Id = 0x00000003; } // namespace OnMode namespace GeneratedCommandList { @@ -2853,7 +2833,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index f40a66c5d8e94a..9be3dacbbae75d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -151,30 +151,30 @@ static constexpr ClusterId Id = 0x00000046; namespace ModeSelect { static constexpr ClusterId Id = 0x00000050; } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { static constexpr ClusterId Id = 0x00000051; -} // namespace LaundryWasherModeSelect -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +} // namespace LaundryWasherMode +namespace RefrigeratorAndTemperatureControlledCabinetMode { static constexpr ClusterId Id = 0x00000052; -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode namespace WasherControls { static constexpr ClusterId Id = 0x00000053; } // namespace WasherControls -namespace RvcRunModeSelect { +namespace RvcRunMode { static constexpr ClusterId Id = 0x00000054; -} // namespace RvcRunModeSelect -namespace RvcCleanModeSelect { +} // namespace RvcRunMode +namespace RvcCleanMode { static constexpr ClusterId Id = 0x00000055; -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { static constexpr ClusterId Id = 0x00000056; } // namespace TemperatureControl namespace RefrigeratorAlarm { static constexpr ClusterId Id = 0x00000057; } // namespace RefrigeratorAlarm -namespace DishwasherModeSelect { +namespace DishwasherMode { static constexpr ClusterId Id = 0x00000059; -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace AirQuality { static constexpr ClusterId Id = 0x0000005B; } // namespace AirQuality diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 6e1e48f4ed2307..f81eea1404fb8a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -638,88 +638,64 @@ namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - -namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; -} // namespace ChangeToModeResponse - } // namespace Commands } // namespace ModeSelect -namespace LaundryWasherModeSelect { +namespace LaundryWasherMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace LaundryWasherModeSelect +} // namespace LaundryWasherMode -namespace RefrigeratorAndTemperatureControlledCabinetModeSelect { +namespace RefrigeratorAndTemperatureControlledCabinetMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace RefrigeratorAndTemperatureControlledCabinetModeSelect +} // namespace RefrigeratorAndTemperatureControlledCabinetMode -namespace RvcRunModeSelect { +namespace RvcRunMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace RvcRunModeSelect +} // namespace RvcRunMode -namespace RvcCleanModeSelect { +namespace RvcCleanMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace RvcCleanModeSelect +} // namespace RvcCleanMode namespace TemperatureControl { namespace Commands { @@ -731,23 +707,19 @@ static constexpr CommandId Id = 0x00000000; } // namespace Commands } // namespace TemperatureControl -namespace DishwasherModeSelect { +namespace DishwasherMode { namespace Commands { namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace ChangeToModeWithStatus { -static constexpr CommandId Id = 0x00000001; -} // namespace ChangeToModeWithStatus - namespace ChangeToModeResponse { -static constexpr CommandId Id = 0x00000002; +static constexpr CommandId Id = 0x00000001; } // namespace ChangeToModeResponse } // namespace Commands -} // namespace DishwasherModeSelect +} // namespace DishwasherMode namespace SmokeCoAlarm { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 0cc18ac44b09e3..3052095d47d1a9 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -292,20 +292,19 @@ #define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER #endif -#if defined(ZCL_USING_LAUNDRY_WASHER_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_WASHER_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_SELECT_CLUSTER \ - { chip::app::Clusters::LaundryWasherModeSelect::Id, "Laundry Washer Mode Select" }, +#if defined(ZCL_USING_LAUNDRY_WASHER_MODE_CLUSTER_SERVER) || defined(ZCL_USING_LAUNDRY_WASHER_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER { chip::app::Clusters::LaundryWasherMode::Id, "Laundry Washer Mode" }, #else -#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER #endif -#if defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_SERVER) || \ - defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER \ - { chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Id, \ - "Refrigerator And Temperature Controlled Cabinet Mode Select" }, +#if defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_SERVER) || \ + defined(ZCL_USING_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER \ + { chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Id, \ + "Refrigerator And Temperature Controlled Cabinet Mode" }, #else -#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER #endif #if defined(ZCL_USING_WASHER_CONTROLS_CLUSTER_SERVER) || defined(ZCL_USING_WASHER_CONTROLS_CLUSTER_CLIENT) @@ -314,16 +313,16 @@ #define CHIP_PRINTCLUSTER_WASHER_CONTROLS_CLUSTER #endif -#if defined(ZCL_USING_RVC_RUN_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_RVC_RUN_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_SELECT_CLUSTER { chip::app::Clusters::RvcRunModeSelect::Id, "RVC Run Mode Select" }, +#if defined(ZCL_USING_RVC_RUN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_RVC_RUN_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER { chip::app::Clusters::RvcRunMode::Id, "RVC Run Mode" }, #else -#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER #endif -#if defined(ZCL_USING_RVC_CLEAN_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_RVC_CLEAN_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_SELECT_CLUSTER { chip::app::Clusters::RvcCleanModeSelect::Id, "RVC Clean Mode Select" }, +#if defined(ZCL_USING_RVC_CLEAN_MODE_CLUSTER_SERVER) || defined(ZCL_USING_RVC_CLEAN_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER { chip::app::Clusters::RvcCleanMode::Id, "RVC Clean Mode" }, #else -#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER #endif #if defined(ZCL_USING_TEMPERATURE_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_TEMPERATURE_CONTROL_CLUSTER_CLIENT) @@ -338,11 +337,10 @@ #define CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM #endif -#if defined(ZCL_USING_DISHWASHER_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_DISHWASHER_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_SELECT_CLUSTER \ - { chip::app::Clusters::DishwasherModeSelect::Id, "Dishwasher Mode Select" }, +#if defined(ZCL_USING_DISHWASHER_MODE_CLUSTER_SERVER) || defined(ZCL_USING_DISHWASHER_MODE_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER { chip::app::Clusters::DishwasherMode::Id, "Dishwasher Mode" }, #else -#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_SELECT_CLUSTER +#define CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER #endif #if defined(ZCL_USING_AIR_QUALITY_CLUSTER_SERVER) || defined(ZCL_USING_AIR_QUALITY_CLUSTER_CLIENT) @@ -973,14 +971,14 @@ CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER \ CHIP_PRINTCLUSTER_ICD_MANAGEMENT_CLUSTER \ CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_SELECT_CLUSTER \ + CHIP_PRINTCLUSTER_LAUNDRY_WASHER_MODE_CLUSTER \ + CHIP_PRINTCLUSTER_REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER \ CHIP_PRINTCLUSTER_WASHER_CONTROLS_CLUSTER \ - CHIP_PRINTCLUSTER_RVC_RUN_MODE_SELECT_CLUSTER \ - CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_SELECT_CLUSTER \ + CHIP_PRINTCLUSTER_RVC_RUN_MODE_CLUSTER \ + CHIP_PRINTCLUSTER_RVC_CLEAN_MODE_CLUSTER \ CHIP_PRINTCLUSTER_TEMPERATURE_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_REFRIGERATOR_ALARM \ - CHIP_PRINTCLUSTER_DISHWASHER_MODE_SELECT_CLUSTER \ + CHIP_PRINTCLUSTER_DISHWASHER_MODE_CLUSTER \ CHIP_PRINTCLUSTER_AIR_QUALITY_CLUSTER \ CHIP_PRINTCLUSTER_SMOKE_CO_ALARM_CLUSTER \ CHIP_PRINTCLUSTER_OPERATIONAL_STATE_CLUSTER \ @@ -1064,4 +1062,4 @@ CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER -#define MAX_CLUSTER_NAME_LENGTH 59 +#define MAX_CLUSTER_NAME_LENGTH 58 diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index d0c1be59f9f87f..bc33ea2a4d5c96 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -74,14 +74,14 @@ | BooleanState | 0x0045 | | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | -| LaundryWasherModeSelect | 0x0051 | -| RefrigeratorAndTemperatureControlledCabinetModeSelect | 0x0052 | +| LaundryWasherMode | 0x0051 | +| RefrigeratorAndTemperatureControlledCabinetMode | 0x0052 | | WasherControls | 0x0053 | -| RvcRunModeSelect | 0x0054 | -| RvcCleanModeSelect | 0x0055 | +| RvcRunMode | 0x0054 | +| RvcCleanMode | 0x0055 | | TemperatureControl | 0x0056 | | RefrigeratorAlarm | 0x0057 | -| DishwasherModeSelect | 0x0059 | +| DishwasherMode | 0x0059 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | @@ -4035,7 +4035,6 @@ class IcdManagementStayActiveRequest : public ClusterCommand |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -4084,50 +4083,17 @@ class ModeSelectChangeToMode : public ClusterCommand chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; -/* - * Command ChangeToModeWithStatus - */ -class ModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - ModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000050, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000050, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::ModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; -}; - /*----------------------------------------------------------------------------*\ -| Cluster LaundryWasherModeSelect | 0x0051 | +| Cluster LaundryWasherMode | 0x0051 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4141,10 +4107,10 @@ class ModeSelectChangeToModeWithStatus : public ClusterCommand /* * Command ChangeToMode */ -class LaundryWasherModeSelectChangeToMode : public ClusterCommand +class LaundryWasherModeChangeToMode : public ClusterCommand { public: - LaundryWasherModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : + LaundryWasherModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); @@ -4166,53 +4132,20 @@ class LaundryWasherModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class LaundryWasherModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - LaundryWasherModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000051) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000051, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000051) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000051, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::LaundryWasherMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ -| Cluster RefrigeratorAndTemperatureControlledCabinetModeSelect | 0x0052 | +| Cluster RefrigeratorAndTemperatureControlledCabinetMode | 0x0052 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4226,10 +4159,10 @@ class LaundryWasherModeSelectChangeToModeWithStatus : public ClusterCommand /* * Command ChangeToMode */ -class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToMode : public ClusterCommand +class RefrigeratorAndTemperatureControlledCabinetModeChangeToMode : public ClusterCommand { public: - RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : + RefrigeratorAndTemperatureControlledCabinetModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); @@ -4251,38 +4184,7 @@ class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToMode : public } private: - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000052) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000052, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000052) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000052, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -4306,18 +4208,16 @@ class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatu \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ -| Cluster RvcRunModeSelect | 0x0054 | +| Cluster RvcRunMode | 0x0054 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4331,10 +4231,10 @@ class RefrigeratorAndTemperatureControlledCabinetModeSelectChangeToModeWithStatu /* * Command ChangeToMode */ -class RvcRunModeSelectChangeToMode : public ClusterCommand +class RvcRunModeChangeToMode : public ClusterCommand { public: - RvcRunModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) + RvcRunModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); ClusterCommand::AddArguments(); @@ -4355,53 +4255,20 @@ class RvcRunModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class RvcRunModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - RvcRunModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000054) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000054, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000054) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000054, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::RvcRunMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ -| Cluster RvcCleanModeSelect | 0x0055 | +| Cluster RvcCleanMode | 0x0055 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4415,11 +4282,10 @@ class RvcRunModeSelectChangeToModeWithStatus : public ClusterCommand /* * Command ChangeToMode */ -class RvcCleanModeSelectChangeToMode : public ClusterCommand +class RvcCleanModeChangeToMode : public ClusterCommand { public: - RvcCleanModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode", credsIssuerConfig) + RvcCleanModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); ClusterCommand::AddArguments(); @@ -4440,38 +4306,7 @@ class RvcCleanModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class RvcCleanModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - RvcCleanModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000055) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000055, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000055) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000055, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::RvcCleanMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -4549,18 +4384,16 @@ class TemperatureControlSetTemperature : public ClusterCommand \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ -| Cluster DishwasherModeSelect | 0x0059 | +| Cluster DishwasherMode | 0x0059 | |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * Description | 0x0000 | -| * SupportedModes | 0x0002 | -| * CurrentMode | 0x0003 | -| * StartUpMode | 0x0004 | -| * OnMode | 0x0005 | +| * SupportedModes | 0x0000 | +| * CurrentMode | 0x0001 | +| * StartUpMode | 0x0002 | +| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -4574,11 +4407,10 @@ class TemperatureControlSetTemperature : public ClusterCommand /* * Command ChangeToMode */ -class DishwasherModeSelectChangeToMode : public ClusterCommand +class DishwasherModeChangeToMode : public ClusterCommand { public: - DishwasherModeSelectChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode", credsIssuerConfig) + DishwasherModeChangeToMode(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("change-to-mode", credsIssuerConfig) { AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); ClusterCommand::AddArguments(); @@ -4599,38 +4431,7 @@ class DishwasherModeSelectChangeToMode : public ClusterCommand } private: - chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToMode::Type mRequest; -}; - -/* - * Command ChangeToModeWithStatus - */ -class DishwasherModeSelectChangeToModeWithStatus : public ClusterCommand -{ -public: - DishwasherModeSelectChangeToModeWithStatus(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("change-to-mode-with-status", credsIssuerConfig) - { - AddArgument("NewMode", 0, UINT8_MAX, &mRequest.newMode); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000059) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000059, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000059) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000059, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeWithStatus::Type mRequest; + chip::app::Clusters::DishwasherMode::Commands::ChangeToMode::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -14752,9 +14553,8 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -14821,24 +14621,22 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c commands.Register(clusterName, clusterCommands); } -void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterLaundryWasherMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::LaundryWasherModeSelect; + using namespace chip::app::Clusters::LaundryWasherMode; - const char * clusterName = "LaundryWasherModeSelect"; + const char * clusterName = "LaundryWasherMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14850,10 +14648,8 @@ void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssue make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -14875,7 +14671,6 @@ void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssue make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14895,25 +14690,23 @@ void registerClusterLaundryWasherModeSelect(Commands & commands, CredentialIssue commands.Register(clusterName, clusterCommands); } -void registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(Commands & commands, - CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRefrigeratorAndTemperatureControlledCabinetMode(Commands & commands, + CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect; + using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; - const char * clusterName = "RefrigeratorAndTemperatureControlledCabinetModeSelect"; + const char * clusterName = "RefrigeratorAndTemperatureControlledCabinetMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -14925,10 +14718,8 @@ void registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(Comman make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::Type>>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -14950,7 +14741,6 @@ void registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(Comman make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15038,24 +14828,22 @@ void registerClusterWasherControls(Commands & commands, CredentialIssuerCommands commands.Register(clusterName, clusterCommands); } -void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRvcRunMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RvcRunModeSelect; + using namespace chip::app::Clusters::RvcRunMode; - const char * clusterName = "RvcRunModeSelect"; + const char * clusterName = "RvcRunMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15067,10 +14855,8 @@ void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerComman make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -15092,7 +14878,6 @@ void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerComman make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15112,24 +14897,22 @@ void registerClusterRvcRunModeSelect(Commands & commands, CredentialIssuerComman commands.Register(clusterName, clusterCommands); } -void registerClusterRvcCleanModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterRvcCleanMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::RvcCleanModeSelect; + using namespace chip::app::Clusters::RvcCleanMode; - const char * clusterName = "RvcCleanModeSelect"; + const char * clusterName = "RvcCleanMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15141,10 +14924,8 @@ void registerClusterRvcCleanModeSelect(Commands & commands, CredentialIssuerComm make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -15166,7 +14947,6 @@ void registerClusterRvcCleanModeSelect(Commands & commands, CredentialIssuerComm make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15329,24 +15109,22 @@ void registerClusterRefrigeratorAlarm(Commands & commands, CredentialIssuerComma commands.Register(clusterName, clusterCommands); } -void registerClusterDishwasherModeSelect(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterDishwasherMode(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::DishwasherModeSelect; + using namespace chip::app::Clusters::DishwasherMode; - const char * clusterName = "DishwasherModeSelect"; + const char * clusterName = "DishwasherMode"; commands_list clusterCommands = { // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -15358,10 +15136,8 @@ void registerClusterDishwasherModeSelect(Commands & commands, CredentialIssuerCo make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // make_unique>>( + chip::app::DataModel::List>>( Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -15383,7 +15159,6 @@ void registerClusterDishwasherModeSelect(Commands & commands, CredentialIssuerCo make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // @@ -24667,14 +24442,14 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterBooleanState(commands, credsIssuerConfig); registerClusterIcdManagement(commands, credsIssuerConfig); registerClusterModeSelect(commands, credsIssuerConfig); - registerClusterLaundryWasherModeSelect(commands, credsIssuerConfig); - registerClusterRefrigeratorAndTemperatureControlledCabinetModeSelect(commands, credsIssuerConfig); + registerClusterLaundryWasherMode(commands, credsIssuerConfig); + registerClusterRefrigeratorAndTemperatureControlledCabinetMode(commands, credsIssuerConfig); registerClusterWasherControls(commands, credsIssuerConfig); - registerClusterRvcRunModeSelect(commands, credsIssuerConfig); - registerClusterRvcCleanModeSelect(commands, credsIssuerConfig); + registerClusterRvcRunMode(commands, credsIssuerConfig); + registerClusterRvcCleanMode(commands, credsIssuerConfig); registerClusterTemperatureControl(commands, credsIssuerConfig); registerClusterRefrigeratorAlarm(commands, credsIssuerConfig); - registerClusterDishwasherModeSelect(commands, credsIssuerConfig); + registerClusterDishwasherMode(commands, credsIssuerConfig); registerClusterAirQuality(commands, credsIssuerConfig); registerClusterSmokeCoAlarm(commands, credsIssuerConfig); registerClusterOperationalState(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 15f4b09c3119c8..b7ba3d66776751 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -41,13 +41,6 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); valueCopy.removeMember("value"); - if (value.isMember("tagName")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "tagName"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.tagName, value["tagName"])); - } - valueCopy.removeMember("tagName"); - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -55,7 +48,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ModeT { ComplexArgumentParser::Finalize(request.mfgCode); ComplexArgumentParser::Finalize(request.value); - ComplexArgumentParser::Finalize(request.tagName); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ModeOptionStruct::Type & request, @@ -1977,6 +1969,74 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::IcdManagement::Structs ComplexArgumentParser::Finalize(request.fabricIndex); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SemanticTagStruct.mfgCode", "mfgCode", value.isMember("mfgCode"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SemanticTagStruct.value", "value", value.isMember("value"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "mfgCode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.mfgCode, value["mfgCode"])); + valueCopy.removeMember("mfgCode"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); + valueCopy.removeMember("value"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.mfgCode); + ComplexArgumentParser::Finalize(request.value); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ModeOptionStruct.label", "label", value.isMember("label"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ModeOptionStruct.mode", "mode", value.isMember("mode"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ModeOptionStruct.semanticTags", "semanticTags", value.isMember("semanticTags"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"])); + valueCopy.removeMember("label"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "mode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.mode, value["mode"])); + valueCopy.removeMember("mode"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "semanticTags"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.semanticTags, value["semanticTags"])); + valueCopy.removeMember("semanticTags"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.label); + ComplexArgumentParser::Finalize(request.mode); + ComplexArgumentParser::Finalize(request.semanticTags); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 752647ee7e54bf..fd35d2d31115d8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -244,6 +244,16 @@ static CHIP_ERROR Setup(const char * label, static void Finalize(chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::DoorLock::Structs::CredentialStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 9f0e8d02e5e6d3..071648f097ff34 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -41,14 +41,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } - { - CHIP_ERROR err = LogValue("TagName", indent + 1, value.tagName); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'TagName'"); - return err; - } - } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -1777,6 +1769,64 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("MfgCode", indent + 1, value.mfgCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MfgCode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Value", indent + 1, value.value); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Label", indent + 1, value.label); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Mode", indent + 1, value.mode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Mode'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("SemanticTags", indent + 1, value.semanticTags); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SemanticTags'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value) { @@ -4479,16 +4529,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ModeSelect::Commands::ChangeToModeResponse::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("statusText", indent + 1, value.statusText)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4498,7 +4539,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue( const char * label, size_t indent, - const RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4507,7 +4548,7 @@ CHIP_ERROR DataModelLogger::LogValue( return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const RvcRunMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4516,7 +4557,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -4525,7 +4566,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value) + const DishwasherMode::Commands::ChangeToModeResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -7853,62 +7894,56 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case LaundryWasherModeSelect::Id: { + case LaundryWasherMode::Id: { switch (path.mAttributeId) { - case LaundryWasherModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case LaundryWasherModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::LaundryWasherModeSelect::Structs::ModeOptionStruct::DecodableType> + case LaundryWasherMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case LaundryWasherModeSelect::Attributes::CurrentMode::Id: { + case LaundryWasherMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case LaundryWasherModeSelect::Attributes::StartUpMode::Id: { + case LaundryWasherMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case LaundryWasherModeSelect::Attributes::OnMode::Id: { + case LaundryWasherMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case LaundryWasherModeSelect::Attributes::GeneratedCommandList::Id: { + case LaundryWasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case LaundryWasherModeSelect::Attributes::AcceptedCommandList::Id: { + case LaundryWasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case LaundryWasherModeSelect::Attributes::EventList::Id: { + case LaundryWasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case LaundryWasherModeSelect::Attributes::AttributeList::Id: { + case LaundryWasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case LaundryWasherModeSelect::Attributes::FeatureMap::Id: { + case LaundryWasherMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case LaundryWasherModeSelect::Attributes::ClusterRevision::Id: { + case LaundryWasherMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -7916,62 +7951,57 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Id: { switch (path.mAttributeId) { - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Structs::ModeOptionStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::CurrentMode::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::StartUpMode::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::OnMode::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::GeneratedCommandList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::AcceptedCommandList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::EventList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::AttributeList::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::FeatureMap::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Attributes::ClusterRevision::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -8035,61 +8065,55 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RvcRunModeSelect::Id: { + case RvcRunMode::Id: { switch (path.mAttributeId) { - case RvcRunModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case RvcRunModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList - value; + case RvcRunMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case RvcRunModeSelect::Attributes::CurrentMode::Id: { + case RvcRunMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RvcRunModeSelect::Attributes::StartUpMode::Id: { + case RvcRunMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case RvcRunModeSelect::Attributes::OnMode::Id: { + case RvcRunMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case RvcRunModeSelect::Attributes::GeneratedCommandList::Id: { + case RvcRunMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RvcRunModeSelect::Attributes::AcceptedCommandList::Id: { + case RvcRunMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RvcRunModeSelect::Attributes::EventList::Id: { + case RvcRunMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RvcRunModeSelect::Attributes::AttributeList::Id: { + case RvcRunMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RvcRunModeSelect::Attributes::FeatureMap::Id: { + case RvcRunMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RvcRunModeSelect::Attributes::ClusterRevision::Id: { + case RvcRunMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -8097,61 +8121,55 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RvcCleanModeSelect::Id: { + case RvcCleanMode::Id: { switch (path.mAttributeId) { - case RvcCleanModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case RvcCleanModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList - value; + case RvcCleanMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case RvcCleanModeSelect::Attributes::CurrentMode::Id: { + case RvcCleanMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RvcCleanModeSelect::Attributes::StartUpMode::Id: { + case RvcCleanMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case RvcCleanModeSelect::Attributes::OnMode::Id: { + case RvcCleanMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case RvcCleanModeSelect::Attributes::GeneratedCommandList::Id: { + case RvcCleanMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case RvcCleanModeSelect::Attributes::AcceptedCommandList::Id: { + case RvcCleanMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case RvcCleanModeSelect::Attributes::EventList::Id: { + case RvcCleanMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RvcCleanModeSelect::Attributes::AttributeList::Id: { + case RvcCleanMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case RvcCleanModeSelect::Attributes::FeatureMap::Id: { + case RvcCleanMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RvcCleanModeSelect::Attributes::ClusterRevision::Id: { + case RvcCleanMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -8271,61 +8289,56 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case DishwasherModeSelect::Id: { + case DishwasherMode::Id: { switch (path.mAttributeId) { - case DishwasherModeSelect::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Description", 1, value); - } - case DishwasherModeSelect::Attributes::SupportedModes::Id: { - chip::app::DataModel::DecodableList + case DishwasherMode::Attributes::SupportedModes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedModes", 1, value); } - case DishwasherModeSelect::Attributes::CurrentMode::Id: { + case DishwasherMode::Attributes::CurrentMode::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case DishwasherModeSelect::Attributes::StartUpMode::Id: { + case DishwasherMode::Attributes::StartUpMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StartUpMode", 1, value); } - case DishwasherModeSelect::Attributes::OnMode::Id: { + case DishwasherMode::Attributes::OnMode::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("OnMode", 1, value); } - case DishwasherModeSelect::Attributes::GeneratedCommandList::Id: { + case DishwasherMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case DishwasherModeSelect::Attributes::AcceptedCommandList::Id: { + case DishwasherMode::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case DishwasherModeSelect::Attributes::EventList::Id: { + case DishwasherMode::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case DishwasherModeSelect::Attributes::AttributeList::Id: { + case DishwasherMode::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case DishwasherModeSelect::Attributes::FeatureMap::Id: { + case DishwasherMode::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case DishwasherModeSelect::Attributes::ClusterRevision::Id: { + case DishwasherMode::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16354,66 +16367,55 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case ModeSelect::Id: { - switch (path.mCommandId) - { - case ModeSelect::Commands::ChangeToModeResponse::Id: { - ModeSelect::Commands::ChangeToModeResponse::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); - } - } - break; - } - case LaundryWasherModeSelect::Id: { + case LaundryWasherMode::Id: { switch (path.mCommandId) { - case LaundryWasherModeSelect::Commands::ChangeToModeResponse::Id: { - LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case LaundryWasherMode::Commands::ChangeToModeResponse::Id: { + LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Id: { + case RefrigeratorAndTemperatureControlledCabinetMode::Id: { switch (path.mCommandId) { - case RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::Id: { - RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id: { + RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case RvcRunModeSelect::Id: { + case RvcRunMode::Id: { switch (path.mCommandId) { - case RvcRunModeSelect::Commands::ChangeToModeResponse::Id: { - RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case RvcRunMode::Commands::ChangeToModeResponse::Id: { + RvcRunMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case RvcCleanModeSelect::Id: { + case RvcCleanMode::Id: { switch (path.mCommandId) { - case RvcCleanModeSelect::Commands::ChangeToModeResponse::Id: { - RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case RvcCleanMode::Commands::ChangeToModeResponse::Id: { + RvcCleanMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } } break; } - case DishwasherModeSelect::Id: { + case DishwasherMode::Id: { switch (path.mCommandId) { - case DishwasherModeSelect::Commands::ChangeToModeResponse::Id: { - DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType value; + case DishwasherMode::Commands::ChangeToModeResponse::Id: { + DishwasherMode::Commands::ChangeToModeResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ChangeToModeResponse", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 7a5927a2769179..c259176393d7f8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -153,6 +153,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ModeSelect::Structs::SemanticTagStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::DoorLock::Structs::CredentialStruct::DecodableType & value); @@ -460,19 +466,17 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::LaundryWasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetModeSelect::Commands:: - ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::DecodableType & + value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RvcRunModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::RvcCleanModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::DishwasherModeSelect::Commands::ChangeToModeResponse::DecodableType & value); + const chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::DecodableType & value); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 32ce455574153a..cb11f6427d4461 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -84869,7 +84869,7 @@ class TestModeSelectClusterSuite : public TestCommand { public: TestModeSelectClusterSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("TestModeSelectCluster", 31, credsIssuerConfig) + TestCommand("TestModeSelectCluster", 32, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -84918,6 +84918,15 @@ class TestModeSelectClusterSuite : public TestCommand } break; case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("standardNamespace", value)); + VerifyOrReturn(CheckValue("standardNamespace.Value()", value.Value(), 0U)); + } + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList @@ -84930,36 +84939,36 @@ class TestModeSelectClusterSuite : public TestCommand CheckValueAsString("supportedModes[0].label", iter_0.GetValue().label, chip::CharSpan("Black", 5))); VerifyOrReturn(CheckValue("supportedModes[0].mode", iter_0.GetValue().mode, 0U)); { - auto iter_2 = iter_0.GetValue().modeTags.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes[0].modeTags", - iter_2, 0)); - VerifyOrReturn(CheckValue("supportedModes[0].modeTags[0].value", iter_2.GetValue().value, 0U)); - VerifyOrReturn( - CheckNoMoreListItems("supportedModes[0].modeTags", iter_2, 1)); + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[0].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[0].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[0].semanticTags", iter_2, 1)); } VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 1)); VerifyOrReturn( CheckValueAsString("supportedModes[1].label", iter_0.GetValue().label, chip::CharSpan("Cappuccino", 10))); VerifyOrReturn(CheckValue("supportedModes[1].mode", iter_0.GetValue().mode, 4U)); { - auto iter_2 = iter_0.GetValue().modeTags.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes[1].modeTags", - iter_2, 0)); - VerifyOrReturn(CheckValue("supportedModes[1].modeTags[0].value", iter_2.GetValue().value, 0U)); - VerifyOrReturn( - CheckNoMoreListItems("supportedModes[1].modeTags", iter_2, 1)); + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[1].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[1].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[1].semanticTags", iter_2, 1)); } VerifyOrReturn(CheckNextListItemDecodes("supportedModes", iter_0, 2)); VerifyOrReturn( CheckValueAsString("supportedModes[2].label", iter_0.GetValue().label, chip::CharSpan("Espresso", 8))); VerifyOrReturn(CheckValue("supportedModes[2].mode", iter_0.GetValue().mode, 7U)); { - auto iter_2 = iter_0.GetValue().modeTags.begin(); - VerifyOrReturn(CheckNextListItemDecodes("supportedModes[2].modeTags", - iter_2, 0)); - VerifyOrReturn(CheckValue("supportedModes[2].modeTags[0].value", iter_2.GetValue().value, 0U)); - VerifyOrReturn( - CheckNoMoreListItems("supportedModes[2].modeTags", iter_2, 1)); + auto iter_2 = iter_0.GetValue().semanticTags.begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "supportedModes[2].semanticTags", iter_2, 0)); + VerifyOrReturn(CheckValue("supportedModes[2].semanticTags[0].value", iter_2.GetValue().value, 0U)); + VerifyOrReturn(CheckNoMoreListItems( + "supportedModes[2].semanticTags", iter_2, 1)); } VerifyOrReturn(CheckNoMoreListItems("supportedModes", iter_0, 3)); } @@ -84968,7 +84977,7 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckConstraintMaxLength("value", value, 3)); } break; - case 3: + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -84976,7 +84985,7 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, 0U)); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -84985,7 +84994,7 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("startUpMode.Value()", value.Value(), 0U)); } break; - case 5: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -84993,10 +85002,10 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValueNull("onMode", value)); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 7: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -85005,16 +85014,16 @@ class TestModeSelectClusterSuite : public TestCommand currentModeBeforeToggle = value; } break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); - break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -85022,13 +85031,13 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, currentModeBeforeToggle)); } break; - case 12: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 13: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 14: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -85038,13 +85047,13 @@ class TestModeSelectClusterSuite : public TestCommand OnModeValue = value; } break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -85052,13 +85061,13 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, OnModeValue)); } break; - case 18: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 19: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 20: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -85067,9 +85076,6 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("startUpMode.Value()", value.Value(), 7U)); } break; - case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; @@ -85078,13 +85084,16 @@ class TestModeSelectClusterSuite : public TestCommand break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -85092,18 +85101,18 @@ class TestModeSelectClusterSuite : public TestCommand VerifyOrReturn(CheckValue("currentMode", value, 4U)); } break; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -85139,27 +85148,32 @@ class TestModeSelectClusterSuite : public TestCommand chip::NullOptional); } case 2: { - LogStep(2, "Read SupportedModes"); + LogStep(2, "Read StandardNamespace"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StandardNamespace::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read SupportedModes"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::SupportedModes::Id, true, chip::NullOptional); } - case 3: { - LogStep(3, "Read CurrentMode"); + case 4: { + LogStep(4, "Read CurrentMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 4: { - LogStep(4, "Read StartUpMode"); + case 5: { + LogStep(5, "Read StartUpMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, true, chip::NullOptional); } - case 5: { - LogStep(5, "Read OnMode"); + case 6: { + LogStep(6, "Read OnMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, true, chip::NullOptional); } - case 6: { - LogStep(6, "Change to Supported Mode"); + case 7: { + LogStep(7, "Change to Supported Mode"); ListFreer listFreer; chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; value.newMode = 4U; @@ -85168,13 +85182,13 @@ class TestModeSelectClusterSuite : public TestCommand ); } - case 7: { - LogStep(7, "Verify Current Mode Change"); + case 8: { + LogStep(8, "Verify Current Mode Change"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Change to Unsupported Mode"); + case 9: { + LogStep(9, "Change to Unsupported Mode"); ListFreer listFreer; chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; value.newMode = 2U; @@ -85183,29 +85197,29 @@ class TestModeSelectClusterSuite : public TestCommand ); } - case 9: { - LogStep(9, "Toggle OnOff"); + case 10: { + LogStep(10, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional ); } - case 10: { - LogStep(10, "Toggle OnOff"); + case 11: { + LogStep(11, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::On::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional ); } - case 11: { - LogStep(11, "Verify Current Mode does not change when OnMode is null"); + case 12: { + LogStep(12, "Verify Current Mode does not change when OnMode is null"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 12: { - LogStep(12, "Change to Unsupported OnMode"); + case 13: { + LogStep(13, "Change to Unsupported OnMode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -85213,8 +85227,8 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 13: { - LogStep(13, "Change OnMode"); + case 14: { + LogStep(14, "Change OnMode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -85222,34 +85236,34 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 14: { - LogStep(14, "Verify OnMode"); + case 15: { + LogStep(15, "Verify OnMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Toggle OnOff"); + case 16: { + LogStep(16, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional ); } - case 16: { - LogStep(16, "Toggle OnOff"); + case 17: { + LogStep(17, "Toggle OnOff"); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::On::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value, chip::NullOptional ); } - case 17: { - LogStep(17, "Verify Current Mode Changes if OnMode is not null"); + case 18: { + LogStep(18, "Verify Current Mode Changes if OnMode is not null"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 18: { - LogStep(18, "Change to Unsupported StartUp Mode"); + case 19: { + LogStep(19, "Change to Unsupported StartUp Mode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -85257,8 +85271,8 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 19: { - LogStep(19, "Change to Supported StartUp Mode"); + case 20: { + LogStep(20, "Change to Supported StartUp Mode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -85266,13 +85280,13 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 20: { - LogStep(20, "Verify StartUp Mode Change"); + case 21: { + LogStep(21, "Verify StartUp Mode Change"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::StartUpMode::Id, true, chip::NullOptional); } - case 21: { - LogStep(21, "Change CurrentMode to another value"); + case 22: { + LogStep(22, "Change CurrentMode to another value"); ListFreer listFreer; chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type value; value.newMode = 0U; @@ -85281,8 +85295,8 @@ class TestModeSelectClusterSuite : public TestCommand ); } - case 22: { - LogStep(22, "Change On Mode"); + case 23: { + LogStep(23, "Change On Mode"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -85290,8 +85304,8 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 23: { - LogStep(23, "Set StartUpOnOff"); + case 24: { + LogStep(24, "Set StartUpOnOff"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNonNull(); @@ -85299,47 +85313,47 @@ class TestModeSelectClusterSuite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::StartUpOnOff::Id, value, chip::NullOptional, chip::NullOptional); } - case 24: { - LogStep(24, "Reboot target device"); + case 25: { + LogStep(25, "Reboot target device"); ListFreer listFreer; chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot(kIdentityAlpha, value); } - case 25: { - LogStep(25, "Wait for the commissioned device to be retrieved"); + case 26: { + LogStep(26, "Wait for the commissioned device to be retrieved"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } - case 26: { - LogStep(26, "Verify Current Mode Change based on OnMode, as it overwrites StartUpMode"); + case 27: { + LogStep(27, "Verify Current Mode Change based on OnMode, as it overwrites StartUpMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } - case 27: { - LogStep(27, "Change On Mode to Null"); + case 28: { + LogStep(28, "Change On Mode to Null"); ListFreer listFreer; chip::app::DataModel::Nullable value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::OnMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 28: { - LogStep(28, "Reboot target device"); + case 29: { + LogStep(29, "Reboot target device"); ListFreer listFreer; chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot(kIdentityAlpha, value); } - case 29: { - LogStep(29, "Wait for the commissioned device to be retrieved"); + case 30: { + LogStep(30, "Wait for the commissioned device to be retrieved"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } - case 30: { - LogStep(30, "Verify Current Mode Change based on new StartUp Mode"); + case 31: { + LogStep(31, "Verify Current Mode Change based on new StartUp Mode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ModeSelect::Id, ModeSelect::Attributes::CurrentMode::Id, true, chip::NullOptional); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 7e1cd5da8ddfe3..a0ad2c6fd475b1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -77,14 +77,14 @@ | BooleanState | 0x0045 | | IcdManagement | 0x0046 | | ModeSelect | 0x0050 | -| LaundryWasherModeSelect | 0x0051 | -| RefrigeratorAndTemperatureControlledCabinetModeSelect | 0x0052 | +| LaundryWasherMode | 0x0051 | +| RefrigeratorAndTemperatureControlledCabinetMode | 0x0052 | | WasherControls | 0x0053 | -| RvcRunModeSelect | 0x0054 | -| RvcCleanModeSelect | 0x0055 | +| RvcRunMode | 0x0054 | +| RvcCleanMode | 0x0055 | | TemperatureControl | 0x0056 | | RefrigeratorAlarm | 0x0057 | -| DishwasherModeSelect | 0x0059 | +| DishwasherMode | 0x0059 | | AirQuality | 0x005B | | SmokeCoAlarm | 0x005C | | OperationalState | 0x0060 | @@ -39610,7 +39610,6 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * ChangeToModeWithStatus | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | 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 8a3451e3fb84cf..908c734985d6c9 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -127252,121 +127252,125 @@ class TestModeSelectCluster : public TestCommandBridge { err = TestReadDescription_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read SupportedModes\n"); - err = TestReadSupportedModes_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read StandardNamespace\n"); + err = TestReadStandardNamespace_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read CurrentMode\n"); - err = TestReadCurrentMode_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read SupportedModes\n"); + err = TestReadSupportedModes_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read StartUpMode\n"); - err = TestReadStartUpMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read CurrentMode\n"); + err = TestReadCurrentMode_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read OnMode\n"); - err = TestReadOnMode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read StartUpMode\n"); + err = TestReadStartUpMode_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Change to Supported Mode\n"); - err = TestChangeToSupportedMode_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read OnMode\n"); + err = TestReadOnMode_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify Current Mode Change\n"); - err = TestVerifyCurrentModeChange_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Change to Supported Mode\n"); + err = TestChangeToSupportedMode_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Change to Unsupported Mode\n"); - err = TestChangeToUnsupportedMode_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify Current Mode Change\n"); + err = TestVerifyCurrentModeChange_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Toggle OnOff\n"); - err = TestToggleOnOff_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Change to Unsupported Mode\n"); + err = TestChangeToUnsupportedMode_9(); break; case 10: ChipLogProgress(chipTool, " ***** Test Step 10 : Toggle OnOff\n"); err = TestToggleOnOff_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Verify Current Mode does not change when OnMode is null\n"); - err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Toggle OnOff\n"); + err = TestToggleOnOff_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Change to Unsupported OnMode\n"); - err = TestChangeToUnsupportedOnMode_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify Current Mode does not change when OnMode is null\n"); + err = TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Change OnMode\n"); - err = TestChangeOnMode_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Change to Unsupported OnMode\n"); + err = TestChangeToUnsupportedOnMode_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Verify OnMode\n"); - err = TestVerifyOnMode_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Change OnMode\n"); + err = TestChangeOnMode_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Toggle OnOff\n"); - err = TestToggleOnOff_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Verify OnMode\n"); + err = TestVerifyOnMode_15(); break; case 16: ChipLogProgress(chipTool, " ***** Test Step 16 : Toggle OnOff\n"); err = TestToggleOnOff_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Verify Current Mode Changes if OnMode is not null\n"); - err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Toggle OnOff\n"); + err = TestToggleOnOff_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Change to Unsupported StartUp Mode\n"); - err = TestChangeToUnsupportedStartUpMode_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Verify Current Mode Changes if OnMode is not null\n"); + err = TestVerifyCurrentModeChangesIfOnModeIsNotNull_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Supported StartUp Mode\n"); - err = TestChangeToSupportedStartUpMode_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Change to Unsupported StartUp Mode\n"); + err = TestChangeToUnsupportedStartUpMode_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Verify StartUp Mode Change\n"); - err = TestVerifyStartUpModeChange_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Change to Supported StartUp Mode\n"); + err = TestChangeToSupportedStartUpMode_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Change CurrentMode to another value\n"); - err = TestChangeCurrentModeToAnotherValue_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Verify StartUp Mode Change\n"); + err = TestVerifyStartUpModeChange_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Change On Mode\n"); - err = TestChangeOnMode_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Change CurrentMode to another value\n"); + err = TestChangeCurrentModeToAnotherValue_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Set StartUpOnOff\n"); - err = TestSetStartUpOnOff_23(); + ChipLogProgress(chipTool, " ***** Test Step 23 : Change On Mode\n"); + err = TestChangeOnMode_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Reboot target device\n"); - err = TestRebootTargetDevice_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Set StartUpOnOff\n"); + err = TestSetStartUpOnOff_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : Reboot target device\n"); + err = TestRebootTargetDevice_25(); break; case 26: - ChipLogProgress( - chipTool, " ***** Test Step 26 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); - err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_26(); + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Change On Mode to Null\n"); - err = TestChangeOnModeToNull_27(); + ChipLogProgress( + chipTool, " ***** Test Step 27 : Verify Current Mode Change based on OnMode, as it overwrites StartUpMode\n"); + err = TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27(); break; case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Reboot target device\n"); - err = TestRebootTargetDevice_28(); + ChipLogProgress(chipTool, " ***** Test Step 28 : Change On Mode to Null\n"); + err = TestChangeOnModeToNull_28(); break; case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_29(); + ChipLogProgress(chipTool, " ***** Test Step 29 : Reboot target device\n"); + err = TestRebootTargetDevice_29(); break; case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : Verify Current Mode Change based on new StartUp Mode\n"); - err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_30(); + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Verify Current Mode Change based on new StartUp Mode\n"); + err = TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31(); break; } @@ -127404,10 +127408,10 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -127416,10 +127420,10 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -127434,10 +127438,10 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 19: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -127472,6 +127476,9 @@ class TestModeSelectCluster : public TestCommandBridge { case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -127485,7 +127492,7 @@ class TestModeSelectCluster : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 31; + const uint16_t mTestCount = 32; chip::Optional mNodeId; chip::Optional mCluster; @@ -127523,7 +127530,31 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadSupportedModes_2() + CHIP_ERROR TestReadStandardNamespace_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterModeSelect alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStandardNamespaceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read StandardNamespace Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("StandardNamespace", actualValue)); + VerifyOrReturn(CheckValue("StandardNamespace", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadSupportedModes_3() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127541,28 +127572,31 @@ class TestModeSelectCluster : public TestCommandBridge { VerifyOrReturn( CheckValueAsString("Label", ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).label, @"Black")); VerifyOrReturn(CheckValue("Mode", ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).mode, 0U)); - VerifyOrReturn(CheckValue("ModeTags", [((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).modeTags count], - static_cast(1))); + VerifyOrReturn(CheckValue("SemanticTags", + [((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).semanticTags count], static_cast(1))); VerifyOrReturn(CheckValue("Value", - ((MTRModeSelectClusterModeTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]).modeTags[0]) + ((MTRModeSelectClusterSemanticTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[0]) + .semanticTags[0]) .value, 0U)); VerifyOrReturn( CheckValueAsString("Label", ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).label, @"Cappuccino")); VerifyOrReturn(CheckValue("Mode", ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).mode, 4U)); - VerifyOrReturn(CheckValue("ModeTags", [((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).modeTags count], - static_cast(1))); + VerifyOrReturn(CheckValue("SemanticTags", + [((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).semanticTags count], static_cast(1))); VerifyOrReturn(CheckValue("Value", - ((MTRModeSelectClusterModeTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]).modeTags[0]) + ((MTRModeSelectClusterSemanticTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[1]) + .semanticTags[0]) .value, 0U)); VerifyOrReturn( CheckValueAsString("Label", ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).label, @"Espresso")); VerifyOrReturn(CheckValue("Mode", ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).mode, 7U)); - VerifyOrReturn(CheckValue("ModeTags", [((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).modeTags count], - static_cast(1))); + VerifyOrReturn(CheckValue("SemanticTags", + [((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).semanticTags count], static_cast(1))); VerifyOrReturn(CheckValue("Value", - ((MTRModeSelectClusterModeTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]).modeTags[0]) + ((MTRModeSelectClusterSemanticTagStruct *) ((MTRModeSelectClusterModeOptionStruct *) actualValue[2]) + .semanticTags[0]) .value, 0U)); } @@ -127576,7 +127610,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentMode_3() + CHIP_ERROR TestReadCurrentMode_4() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127599,7 +127633,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadStartUpMode_4() + CHIP_ERROR TestReadStartUpMode_5() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127623,7 +127657,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadOnMode_5() + CHIP_ERROR TestReadOnMode_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127646,7 +127680,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToSupportedMode_6() + CHIP_ERROR TestChangeToSupportedMode_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127668,7 +127702,7 @@ class TestModeSelectCluster : public TestCommandBridge { } NSNumber * _Nonnull currentModeBeforeToggle; - CHIP_ERROR TestVerifyCurrentModeChange_7() + CHIP_ERROR TestVerifyCurrentModeChange_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127694,7 +127728,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedMode_8() + CHIP_ERROR TestChangeToUnsupportedMode_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127718,7 +127752,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_9() + CHIP_ERROR TestToggleOnOff_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127736,7 +127770,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_10() + CHIP_ERROR TestToggleOnOff_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127754,7 +127788,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_11() + CHIP_ERROR TestVerifyCurrentModeDoesNotChangeWhenOnModeIsNull_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127777,7 +127811,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedOnMode_12() + CHIP_ERROR TestChangeToUnsupportedOnMode_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127802,7 +127836,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeOnMode_13() + CHIP_ERROR TestChangeOnMode_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127824,7 +127858,7 @@ class TestModeSelectCluster : public TestCommandBridge { } NSNumber * _Nullable OnModeValue; - CHIP_ERROR TestVerifyOnMode_14() + CHIP_ERROR TestVerifyOnMode_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127851,7 +127885,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_15() + CHIP_ERROR TestToggleOnOff_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127869,7 +127903,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestToggleOnOff_16() + CHIP_ERROR TestToggleOnOff_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127887,7 +127921,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_17() + CHIP_ERROR TestVerifyCurrentModeChangesIfOnModeIsNotNull_18() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127910,7 +127944,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToUnsupportedStartUpMode_18() + CHIP_ERROR TestChangeToUnsupportedStartUpMode_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127935,7 +127969,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeToSupportedStartUpMode_19() + CHIP_ERROR TestChangeToSupportedStartUpMode_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127956,7 +127990,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyStartUpModeChange_20() + CHIP_ERROR TestVerifyStartUpModeChange_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -127980,7 +128014,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeCurrentModeToAnotherValue_21() + CHIP_ERROR TestChangeCurrentModeToAnotherValue_22() { MTRBaseDevice * device = GetDevice("alpha"); @@ -128001,7 +128035,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeOnMode_22() + CHIP_ERROR TestChangeOnMode_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -128022,7 +128056,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetStartUpOnOff_23() + CHIP_ERROR TestSetStartUpOnOff_24() { MTRBaseDevice * device = GetDevice("alpha"); @@ -128043,14 +128077,14 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_24() + CHIP_ERROR TestRebootTargetDevice_25() { chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_25() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_26() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -128058,7 +128092,7 @@ class TestModeSelectCluster : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_26() + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnOnModeAsItOverwritesStartUpMode_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -128081,7 +128115,7 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestChangeOnModeToNull_27() + CHIP_ERROR TestChangeOnModeToNull_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -128102,14 +128136,14 @@ class TestModeSelectCluster : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRebootTargetDevice_28() + CHIP_ERROR TestRebootTargetDevice_29() { chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; return Reboot("alpha", value); } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_29() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_30() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -128117,7 +128151,7 @@ class TestModeSelectCluster : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_30() + CHIP_ERROR TestVerifyCurrentModeChangeBasedOnNewStartUpMode_31() { MTRBaseDevice * device = GetDevice("alpha"); From 90f4f7cf2ea27f41345c51792ff886c68d1fd154 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 16 Jun 2023 11:38:19 -0400 Subject: [PATCH 30/31] Fix stamp file creation for zap unit test. (#27296) unittest.main by default calls sys.exit so we did not get a chance to create the stamp file. Fix this and handle sys exit logic separately. Co-authored-by: Andrei Litvin --- scripts/tools/zap/test_generate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/tools/zap/test_generate.py b/scripts/tools/zap/test_generate.py index ff7ea2c20e74c2..d0ada5c22577b4 100755 --- a/scripts/tools/zap/test_generate.py +++ b/scripts/tools/zap/test_generate.py @@ -197,7 +197,9 @@ def process_arguments(): PROGRAM_ARGUMENTS = process_args - unittest.main(argv=unittest_args) + test_results = unittest.main(argv=unittest_args, exit=False) + if test_results.result.failures: + sys.exit(1) if process_args.stamp_file: open(process_args.stamp_file, "wb").close() From 3be88f8336b46dc66933e25bc4d7f4b5999d1d6b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 16 Jun 2023 18:08:39 +0200 Subject: [PATCH 31/31] [chip-tool] The error is not reported over websocket when a read/subscribe action has a global error (#27040) --- examples/chip-tool/commands/clusters/ClusterCommand.h | 6 +++--- examples/chip-tool/commands/clusters/ReportCommand.h | 10 ++++++---- .../commands/clusters/WriteAttributeCommand.h | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/chip-tool/commands/clusters/ClusterCommand.h b/examples/chip-tool/commands/clusters/ClusterCommand.h index eb9a7167948bf5..6b68e1b04bfea0 100644 --- a/examples/chip-tool/commands/clusters/ClusterCommand.h +++ b/examples/chip-tool/commands/clusters/ClusterCommand.h @@ -74,7 +74,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -83,7 +83,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub if (data != nullptr) { - ReturnOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data)); + LogErrorOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data)); error = DataModelLogger::LogCommand(path, data); if (CHIP_NO_ERROR != error) @@ -97,7 +97,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub virtual void OnError(const chip::app::CommandSender * client, CHIP_ERROR error) override { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index f7e1993e26b70b..e90fb5ddf28f14 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -37,7 +37,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -51,7 +51,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi return; } - ReturnOnFailure(RemoteDataModelLogger::LogAttributeAsJSON(path, data)); + LogErrorOnFailure(RemoteDataModelLogger::LogAttributeAsJSON(path, data)); error = DataModelLogger::LogAttribute(path, data); if (CHIP_NO_ERROR != error) @@ -70,7 +70,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi CHIP_ERROR error = status->ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(eventHeader, *status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(eventHeader, *status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -85,7 +85,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi return; } - ReturnOnFailure(RemoteDataModelLogger::LogEventAsJSON(eventHeader, data)); + LogErrorOnFailure(RemoteDataModelLogger::LogEventAsJSON(eventHeader, data)); CHIP_ERROR error = DataModelLogger::LogEvent(eventHeader, data); if (CHIP_NO_ERROR != error) @@ -98,6 +98,8 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi void OnError(CHIP_ERROR error) override { + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); + ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; } diff --git a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h index c3cea8783dbdd0..46a0b3dc4b37dd 100644 --- a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h +++ b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h @@ -120,7 +120,7 @@ class WriteAttribute : public InteractionModelWriter, public ModelCommand, publi CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -129,7 +129,7 @@ class WriteAttribute : public InteractionModelWriter, public ModelCommand, publi void OnError(const chip::app::WriteClient * client, CHIP_ERROR error) override { - ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); + LogErrorOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error;