From 75b822f96be77bdf9e6a4b3f351e59a70d1740e5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 6 May 2022 05:04:45 -0400 Subject: [PATCH 01/19] Use true/false for keepSubscriptions documentation. (#18131) Now that we support using true and false for booleans on the chip-tool command line, the docs should suggest that. --- examples/chip-tool/commands/clusters/ReportCommand.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index 2b5dbd756ba506..98ae546af1de22 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -534,7 +534,7 @@ class SubscribeEvent : public ReportCommand AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval, 0, "The requested maximum interval between reports. Sets MaxIntervalCeiling in the Subscribe Request."); AddArgument("keepSubscriptions", 0, 1, &mKeepSubscriptions, - "0 - Terminate existing subscriptions from initiator.\n 1 - Otherwise."); + "false - Terminate existing subscriptions from initiator.\n true - Leave existing subscriptions in place."); AddArgument("event-min", 0, UINT64_MAX, &mEventNumber); ReportCommand::AddArguments(); } From baf18fffdab440e82e10bcfb9310188a1d7282d2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 6 May 2022 09:57:50 -0400 Subject: [PATCH 02/19] Zap regen (#18153) --- .../all-clusters-common/all-clusters-app.matter | 8 ++++---- examples/bridge-app/bridge-common/bridge-app.matter | 8 ++++---- .../light-switch-common/light-switch-app.matter | 8 ++++---- .../lighting-app/lighting-common/lighting-app.matter | 8 ++++---- examples/lock-app/lock-common/lock-app.matter | 8 ++++---- .../log-source-common/log-source-app.matter | 4 ++-- .../ota-provider-common/ota-provider-app.matter | 8 ++++---- .../ota-requestor-common/ota-requestor-app.matter | 8 ++++---- examples/placeholder/linux/apps/app1/config.matter | 8 ++++---- examples/placeholder/linux/apps/app2/config.matter | 8 ++++---- examples/pump-app/pump-common/pump-app.matter | 12 ++++++------ .../pump-controller-app.matter | 12 ++++++------ .../esp32/main/temperature-measurement.matter | 8 ++++---- .../thermostat/thermostat-common/thermostat.matter | 8 ++++---- examples/tv-app/tv-common/tv-app.matter | 8 ++++---- .../tv-casting-common/tv-casting-app.matter | 8 ++++---- examples/window-app/common/window-app.matter | 12 ++++++------ 17 files changed, 72 insertions(+), 72 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index c82e56ca3c71cc..fde1b2f6831735 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 @@ -3861,8 +3861,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -4015,8 +4015,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 45a557f025f1ee..8683e55092e9d2 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1199,8 +1199,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -1353,8 +1353,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; 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 699ef9d33487ca..3edd000dae4d64 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 @@ -1729,8 +1729,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -1886,8 +1886,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index cf2bad7ef40d6c..bacf6ad4bbe27e 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1717,8 +1717,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -1874,8 +1874,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 1f8ee40a1166f5..3ee8e81a8d0876 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1884,8 +1884,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -2038,8 +2038,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; 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 8f62bccacbc1f6..48f5042cd68cea 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 @@ -420,8 +420,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; ram attribute clusterRevision default = 1; } 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 7f041359332238..33eceb0495ebbf 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 @@ -635,8 +635,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap; ram attribute clusterRevision default = 1; @@ -658,8 +658,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; 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 a56dceb44b283e..215ec1118eb787 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 @@ -689,8 +689,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap; ram attribute clusterRevision default = 1; @@ -719,8 +719,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 6c37accc628c42..7d0b29e4791a77 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -2632,8 +2632,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; @@ -2728,8 +2728,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 6c37accc628c42..7d0b29e4791a77 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2632,8 +2632,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; callback attribute generatedCommandList; callback attribute acceptedCommandList; @@ -2728,8 +2728,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index aee824c7ac3520..81f484284ad556 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1670,8 +1670,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -1796,8 +1796,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute featureMap; @@ -1807,8 +1807,8 @@ endpoint 0 { server cluster GroupKeyManagement { callback attribute groupKeyMap; callback attribute groupTable; - ram attribute maxGroupsPerFabric; - ram attribute maxGroupKeysPerFabric; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; ram attribute featureMap; ram attribute clusterRevision default = 1; } 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 f238cb32b2ed9e..6b5bdb9f387078 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 @@ -1390,8 +1390,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -1519,8 +1519,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute featureMap; @@ -1530,8 +1530,8 @@ endpoint 0 { server cluster GroupKeyManagement { callback attribute groupKeyMap; callback attribute groupTable; - ram attribute maxGroupsPerFabric; - ram attribute maxGroupKeysPerFabric; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; ram attribute featureMap; ram attribute clusterRevision default = 1; } diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter index 1f6127c8bff459..807bdebd20b5ac 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.matter @@ -809,8 +809,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 2; ram attribute clusterRevision default = 1; @@ -892,8 +892,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 69353934349c07..03c0315042e872 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1440,8 +1440,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -1594,8 +1594,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 82ec663bba2c50..5726bb6048fb65 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -2073,8 +2073,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -2227,8 +2227,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; 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 53fb87f29f9acd..6ab9bf6936b853 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 @@ -2247,8 +2247,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute supportsConcurrentConnection default = 1; ram attribute featureMap default = 6; ram attribute clusterRevision default = 1; @@ -2401,8 +2401,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; ram attribute clusterRevision default = 1; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index ce2524751097f6..250799bf162b82 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1477,8 +1477,8 @@ endpoint 0 { server cluster GeneralCommissioning { ram attribute breadcrumb; callback attribute basicCommissioningInfo; - ram attribute regulatoryConfig; - ram attribute locationCapability; + callback attribute regulatoryConfig; + callback attribute locationCapability; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; @@ -1639,8 +1639,8 @@ endpoint 0 { server cluster OperationalCredentials { callback attribute NOCs; callback attribute fabrics; - ram attribute supportedFabrics; - ram attribute commissionedFabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; callback attribute generatedCommandList; @@ -1652,8 +1652,8 @@ endpoint 0 { server cluster GroupKeyManagement { callback attribute groupKeyMap; callback attribute groupTable; - ram attribute maxGroupsPerFabric; - ram attribute maxGroupKeysPerFabric; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; From 1f2e38e74a23bd5294f7632f8b4c4458c20a8cd2 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 6 May 2022 10:40:53 -0400 Subject: [PATCH 03/19] Change key for event number counter (#18115) --- src/lib/support/DefaultStorageKeyAllocator.h | 2 +- src/lib/support/PersistedCounter.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/support/DefaultStorageKeyAllocator.h b/src/lib/support/DefaultStorageKeyAllocator.h index 59ae149827727b..e908256da79c97 100644 --- a/src/lib/support/DefaultStorageKeyAllocator.h +++ b/src/lib/support/DefaultStorageKeyAllocator.h @@ -108,7 +108,7 @@ class DefaultStorageKeyAllocator static const char * OTATargetVersion() { return "g/o/tv"; } // Event number counter. - const char * IMEventNumber() { return Format("g/im/e"); } + const char * IMEventNumber() { return Format("g/im/ec"); } private: // The ENFORCE_FORMAT args are "off by one" because this is a class method, diff --git a/src/lib/support/PersistedCounter.h b/src/lib/support/PersistedCounter.h index 55e870f870d46e..f17434aab40305 100644 --- a/src/lib/support/PersistedCounter.h +++ b/src/lib/support/PersistedCounter.h @@ -197,7 +197,7 @@ class PersistedCounter : public MonotonicallyIncreasingCounter ReturnErrorOnFailure(err); } - if (size > sizeof(valueLE)) + if (size != sizeof(valueLE)) { // TODO: Again, figure out whether this could lead to bootloops. return CHIP_ERROR_INCORRECT_STATE; From 54268504cd1e84aae00a5eb29d1211067c7dff72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Fri, 6 May 2022 16:42:17 +0200 Subject: [PATCH 04/19] [srp] Fix SRP buffer sizes (#18139) The code for calculating buffer sizes used for SRP service data wrongly assumed that commissionable services are used only when the extended discovery is enabled. This wasn't caught before because the extended discovery was enabled by default on all Thread platforms (until recently). Signed-off-by: Damian Krolik --- .../GenericThreadStackManagerImpl_OpenThread.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index 397658b146ee5f..5fb7fccf20801e 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -171,21 +171,13 @@ class GenericThreadStackManagerImpl_OpenThread static constexpr uint8_t kDefaultDomainNameSize = 20; static constexpr uint8_t kMaxDomainNameSize = 32; -#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY - // Thread supports both operational and commissionable discovery, so buffers sizes must be worst case. + // SRP is used for both operational and commissionable services, so buffers sizes must be worst case. static constexpr size_t kSubTypeMaxNumber = Dnssd::Common::kSubTypeMaxNumber; static constexpr size_t kSubTypeTotalLength = Dnssd::Common::kSubTypeTotalLength; static constexpr size_t kTxtMaxNumber = std::max(Dnssd::CommissionAdvertisingParameters::kTxtMaxNumber, Dnssd::OperationalAdvertisingParameters::kTxtMaxNumber); static constexpr size_t kTxtTotalValueLength = std::max(Dnssd::CommissionAdvertisingParameters::kTxtTotalValueSize, Dnssd::OperationalAdvertisingParameters::kTxtTotalValueSize); -#else - // Thread only supports operational discovery. - static constexpr size_t kSubTypeMaxNumber = Dnssd::Operational::kSubTypeMaxNumber; - static constexpr size_t kSubTypeTotalLength = Dnssd::Operational::kSubTypeTotalLength; - static constexpr size_t kTxtMaxNumber = Dnssd::OperationalAdvertisingParameters::kTxtMaxNumber; - static constexpr size_t kTxtTotalValueLength = Dnssd::OperationalAdvertisingParameters::kTxtTotalValueSize; -#endif static constexpr size_t kServiceBufferSize = Dnssd::Common::kInstanceNameMaxLength + 1 + // add null-terminator Dnssd::kDnssdTypeAndProtocolMaxSize + 1 + // add null-terminator From 68518ced655272583e613af7a683bf3a3fc91aca Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 6 May 2022 10:46:29 -0400 Subject: [PATCH 05/19] Fix "ethernet" pairing for chip-tool-darwin. (#18111) Makes the various pairDevice APIs on CHIPDeviceController have identical behavior in terms of just establishing a PASE session and waiting for the API consumer to call commissionDevice as desired. Without this change, both the API implementation and chip-tool-darwin's pairing delegate would try to commission the same device, which would fail. --- .../commands/pairing/PairingCommandBridge.mm | 1 - .../Framework/CHIP/CHIPDeviceController.h | 33 ++++++++++++++++++- .../Framework/CHIP/CHIPDeviceController.mm | 8 ++--- .../Framework/CHIPTests/CHIPClustersTests.m | 12 +++---- .../Framework/CHIPTests/CHIPDeviceTests.m | 16 ++++----- .../CHIPTests/CHIPXPCListenerSampleTests.m | 15 ++++----- 6 files changed, 52 insertions(+), 33 deletions(-) diff --git a/examples/chip-tool-darwin/commands/pairing/PairingCommandBridge.mm b/examples/chip-tool-darwin/commands/pairing/PairingCommandBridge.mm index 3b90ece6bbdf72..d43d98f8ec81b6 100644 --- a/examples/chip-tool-darwin/commands/pairing/PairingCommandBridge.mm +++ b/examples/chip-tool-darwin/commands/pairing/PairingCommandBridge.mm @@ -96,7 +96,6 @@ [CurrentCommissioner() pairDevice:mNodeId address:[NSString stringWithUTF8String:ipAddress] port:mRemotePort - discriminator:mDiscriminator setupPINCode:mSetupPINCode error:error]; } diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.h b/src/darwin/Framework/CHIP/CHIPDeviceController.h index 1a5d0f3b31397f..6fa3ab5e582561 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.h +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.h @@ -35,18 +35,49 @@ typedef void (^CHIPDeviceConnectionCallback)(CHIPDevice * _Nullable device, NSEr @property (readonly, nonatomic) BOOL isRunning; +/** + * Start pairing for a device with the given ID, using the provided setup PIN + * to establish a PASE connection. + * + * The IP and port for the device will be discovered automatically based on the + * provided discriminator. + * + * The pairing process will proceed until a PASE session is established or an + * error occurs, then notify onPairingComplete on the CHIPDevicePairingDelegate + * for this controller. That delegate is expected to call commissionDevice + * after that point if it wants to commission the device. + */ - (BOOL)pairDevice:(uint64_t)deviceID discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode error:(NSError * __autoreleasing *)error; +/** + * Start pairing for a device with the given ID, using the provided IP address + * and port to connect to the device and the provided setup PIN to establish a + * PASE connection. + * + * The pairing process will proceed until a PASE session is established or an + * error occurs, then notify onPairingComplete on the CHIPDevicePairingDelegate + * for this controller. That delegate is expected to call commissionDevice + * after that point if it wants to commission the device. + */ - (BOOL)pairDevice:(uint64_t)deviceID address:(NSString *)address port:(uint16_t)port - discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode error:(NSError * __autoreleasing *)error; +/** + * Start pairing for a device with the given ID and onboarding payload (QR code + * or manual setup code). The payload will be used to discover the device and + * establish a PASE connection. + * + * The pairing process will proceed until a PASE session is established or an + * error occurs, then notify onPairingComplete on the CHIPDevicePairingDelegate + * for this controller. That delegate is expected to call commissionDevice + * after that point if it wants to commission the device. + */ - (BOOL)pairDevice:(uint64_t)deviceID onboardingPayload:(NSString *)onboardingPayload error:(NSError * __autoreleasing *)error; - (BOOL)commissionDevice:(uint64_t)deviceId commissioningParams:(CHIPCommissioningParameters *)commissioningParams diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.mm b/src/darwin/Framework/CHIP/CHIPDeviceController.mm index d27a571888c626..c59b4def0b3753 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.mm +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.mm @@ -315,7 +315,6 @@ - (BOOL)pairDevice:(uint64_t)deviceID - (BOOL)pairDevice:(uint64_t)deviceID address:(NSString *)address port:(uint16_t)port - discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode error:(NSError * __autoreleasing *)error { @@ -330,13 +329,10 @@ - (BOOL)pairDevice:(uint64_t)deviceID chip::Inet::IPAddress::FromString([address UTF8String], addr); chip::Transport::PeerAddress peerAddress = chip::Transport::PeerAddress::UDP(addr, port); - chip::RendezvousParameters params = chip::RendezvousParameters() - .SetSetupPINCode(setupPINCode) - .SetDiscriminator(discriminator) - .SetPeerAddress(peerAddress); + chip::RendezvousParameters params = chip::RendezvousParameters().SetSetupPINCode(setupPINCode).SetPeerAddress(peerAddress); if ([self isRunning]) { _operationalCredentialsDelegate->SetDeviceID(deviceID); - errorCode = self.cppCommissioner->PairDevice(deviceID, params); + errorCode = self.cppCommissioner->EstablishPASEConnection(deviceID, params); } success = ![self checkForError:errorCode logMsg:kErrorPairDevice error:error]; }); diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index ee60eb2c7150ca..99f1f6e9d25ee4 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -38,7 +38,6 @@ const uint16_t kCASESetupTimeoutInSeconds = 30; const uint16_t kTimeoutInSeconds = 20; const uint64_t nodeId = 0x12344321; -const uint16_t kDiscriminator = 3840; const uint32_t kSetupPINCode = 20202021; const uint16_t kRemotePort = 5540; const uint16_t kLocalPort = 5541; @@ -75,6 +74,10 @@ - (id)initWithExpectation:(XCTestExpectation *)expectation - (void)onPairingComplete:(NSError *)error { XCTAssertEqual(error.code, 0); + NSError * commissionError = nil; + [sController commissionDevice:nodeId commissioningParams:[[CHIPCommissioningParameters alloc] init] error:&commissionError]; + XCTAssertNil(commissionError); + // Keep waiting for onCommissioningComplete } @@ -134,12 +137,7 @@ - (void)testInitStack [controller setPairingDelegate:pairing queue:callbackQueue]; NSError * error; - [controller pairDevice:nodeId - address:kAddress - port:kRemotePort - discriminator:kDiscriminator - setupPINCode:kSetupPINCode - error:&error]; + [controller pairDevice:nodeId address:kAddress port:kRemotePort setupPINCode:kSetupPINCode error:&error]; XCTAssertEqual(error.code, 0); [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; diff --git a/src/darwin/Framework/CHIPTests/CHIPDeviceTests.m b/src/darwin/Framework/CHIPTests/CHIPDeviceTests.m index 023eab9bce5c8f..93cd6029baf2f8 100644 --- a/src/darwin/Framework/CHIPTests/CHIPDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPDeviceTests.m @@ -41,7 +41,6 @@ static const uint16_t kCASESetupTimeoutInSeconds = 30; static const uint16_t kTimeoutInSeconds = 3; static const uint64_t kDeviceId = 0x12344321; -static const uint16_t kDiscriminator = 3840; static const uint32_t kSetupPINCode = 20202021; static const uint16_t kRemotePort = 5540; static const uint16_t kLocalPort = 5541; @@ -98,8 +97,12 @@ - (id)initWithExpectation:(XCTestExpectation *)expectation - (void)onPairingComplete:(NSError *)error { XCTAssertEqual(error.code, 0); - [_expectation fulfill]; - _expectation = nil; + + NSError * commissionError = nil; + [sController commissionDevice:kDeviceId commissioningParams:[[CHIPCommissioningParameters alloc] init] error:&commissionError]; + XCTAssertNil(commissionError); + + // Keep waiting for onCommissioningComplete } - (void)onCommissioningComplete:(NSError *)error @@ -166,12 +169,7 @@ - (void)initStack [controller setPairingDelegate:pairing queue:callbackQueue]; NSError * error; - [controller pairDevice:kDeviceId - address:kAddress - port:kRemotePort - discriminator:kDiscriminator - setupPINCode:kSetupPINCode - error:&error]; + [controller pairDevice:kDeviceId address:kAddress port:kRemotePort setupPINCode:kSetupPINCode error:&error]; XCTAssertEqual(error.code, 0); [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; diff --git a/src/darwin/Framework/CHIPTests/CHIPXPCListenerSampleTests.m b/src/darwin/Framework/CHIPTests/CHIPXPCListenerSampleTests.m index 1e231485795db5..ff5db02826db2a 100644 --- a/src/darwin/Framework/CHIPTests/CHIPXPCListenerSampleTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPXPCListenerSampleTests.m @@ -430,7 +430,6 @@ - (void)readAttributeCacheWithController:(id _Nullable)controller static const uint16_t kCASESetupTimeoutInSeconds = 30; static const uint16_t kTimeoutInSeconds = 3; static const uint64_t kDeviceId = 0x12344321; -static const uint16_t kDiscriminator = 3840; static const uint32_t kSetupPINCode = 20202021; static const uint16_t kRemotePort = 5540; static const uint16_t kLocalPort = 5541; @@ -465,8 +464,11 @@ - (id)initWithExpectation:(XCTestExpectation *)expectation - (void)onPairingComplete:(NSError *)error { XCTAssertEqual(error.code, 0); - [_expectation fulfill]; - _expectation = nil; + NSError * commissionError = nil; + [sController commissionDevice:kDeviceId commissioningParams:[[CHIPCommissioningParameters alloc] init] error:&commissionError]; + XCTAssertNil(commissionError); + + // Keep waiting for onCommissioningComplete } - (void)onCommissioningComplete:(NSError *)error @@ -535,12 +537,7 @@ - (void)initStack [controller setPairingDelegate:pairing queue:callbackQueue]; NSError * error; - [controller pairDevice:kDeviceId - address:kAddress - port:kRemotePort - discriminator:kDiscriminator - setupPINCode:kSetupPINCode - error:&error]; + [controller pairDevice:kDeviceId address:kAddress port:kRemotePort setupPINCode:kSetupPINCode error:&error]; XCTAssertEqual(error.code, 0); [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; From d5cf7145279d3779829b68e9ba460b786b98791d Mon Sep 17 00:00:00 2001 From: Song GUO Date: Fri, 6 May 2022 22:49:20 +0800 Subject: [PATCH 06/19] [zap] Pull zap for #17833 (#18134) --- third_party/zap/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/zap/repo b/third_party/zap/repo index 279e3a4c3df58f..268547c0b0ce33 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 279e3a4c3df58f9e4a8478a6203f69bf3ed210ac +Subproject commit 268547c0b0ce33e0fb46a83991b850c7b4da2671 From 96f31bc4d8f2657d36b57e4d1a31eafc2b24caca Mon Sep 17 00:00:00 2001 From: Martin Turon Date: Fri, 6 May 2022 08:04:50 -0700 Subject: [PATCH 07/19] [docs] Improve docs on chip-tool tests. Add example. Fix broken links. (#18112) * [docs] Improve docs on chip-tool tests. Add example. Fix broken links. * Fix misspell and use a more special nodeid for examples Co-authored-by: Andrei Litvin --- docs/guides/chip_tool_guide.md | 21 +++++++++++++++++++++ src/app/tests/suites/README.md | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/guides/chip_tool_guide.md b/docs/guides/chip_tool_guide.md index d81c35c8dcb793..a516faef4a79ec 100644 --- a/docs/guides/chip_tool_guide.md +++ b/docs/guides/chip_tool_guide.md @@ -657,6 +657,27 @@ In this command: - __ is the name of the particular test. +#### Example: running `TestClusters` test + +As an example of running one test suite test: + +``` +# Clean initialization of state. +rm -fr /tmp/chip_* + +# In a shell window, start the DUT device. +./out/debug/standalone/chip-all-clusters-app + +# In a second shell window, pair the DUT with chip-tool. +./out/debug/standalone/chip-tool pairing onnetwork 333221 20202021 + +# Now run the test +./out/debug/standalone/chip-tool tests TestCluster --nodeId 333221 +``` + +Developer details on how the test suite is structured can be found +[here](../../src/app/tests/suites/README.md). + ### Parsing the setup payload The CHIP Tool offers a utility for parsing the Matter onboarding setup payload diff --git a/src/app/tests/suites/README.md b/src/app/tests/suites/README.md index 62f441aeeca6fd..0d7e1da117d639 100644 --- a/src/app/tests/suites/README.md +++ b/src/app/tests/suites/README.md @@ -246,10 +246,10 @@ Top level key to define a YAML test: [test](#property-test) [tests.js](../../../../examples/placeholder/linux/apps/app1/tests.js) - chip-tool(darwin) tests: - [tests.js](../../../../examples/chip-tool-darwin/templates/tests.js) + [tests.js](../../../../examples/chip-tool-darwin/templates/tests/tests.js) - chip-tool tests: - [tests.js](../../../../examples/chip-tool/templates/tests.js) + [tests.js](../../../../examples/chip-tool/templates/tests/tests.js) ```javascript // Manual test definitions. Does not run in CI. From 2e346b2a10fdd6745e5083a103338d0d42f7f7ab Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 6 May 2022 11:06:04 -0400 Subject: [PATCH 08/19] Removed some methods that are unused from af-events.cpp (#18099) * Start removing some unused methods from af-event * Remove also emAfGetTimerDurationAndUnitFromMS * Remove emberAfEventControlSetDelayMinutes * Remove emberAfEventControlSetDelayQS * Remove emAfInitEvents as it seems to be completely empty * Restyle * Remove emAfStackEventString --- src/app/util/af-event.cpp | 81 --------------------------------------- src/app/util/af-event.h | 12 ------ src/app/util/af.h | 22 ----------- src/app/util/util.cpp | 3 -- 4 files changed, 118 deletions(-) diff --git a/src/app/util/af-event.cpp b/src/app/util/af-event.cpp index 9cc2b8495a71d4..31a87bae250fa5 100644 --- a/src/app/util/af-event.cpp +++ b/src/app/util/af-event.cpp @@ -120,19 +120,9 @@ void EventControlHandler(chip::System::Layer * systemLayer, void * appState) } } -const char emAfStackEventString[] = "Stack"; - // ***************************************************************************** // Functions -// A function used to initialize events for idling -void emAfInitEvents(void) {} - -const char * emberAfGetEventString(uint8_t index) -{ - return (index == 0XFF ? emAfStackEventString : emAfEventStrings[index]); -} - static EmberAfEventContext * findEventContext(EndpointId endpoint, ClusterId clusterId, bool isClient) { #if defined(EMBER_AF_GENERATED_EVENT_CONTEXT) @@ -189,26 +179,6 @@ void emberEventControlSetActive(EmberEventControl * control) #endif } -EmberStatus emberAfEventControlSetDelayQS(EmberEventControl * control, uint32_t delayQs) -{ - if (delayQs <= EMBER_MAX_EVENT_CONTROL_DELAY_QS) - { - return emberEventControlSetDelayMS(control, delayQs << 8); - } - - return EMBER_BAD_ARGUMENT; -} - -EmberStatus emberAfEventControlSetDelayMinutes(EmberEventControl * control, uint16_t delayM) -{ - if (delayM <= EMBER_MAX_EVENT_CONTROL_DELAY_MINUTES) - { - return emberEventControlSetDelayMS(control, static_cast(delayM) << 16); - } - - return EMBER_BAD_ARGUMENT; -} - EmberStatus emberAfScheduleTickExtended(EndpointId endpoint, ClusterId clusterId, bool isClient, uint32_t delayMs, EmberAfEventPollControl pollControl, EmberAfEventSleepControl sleepControl) { @@ -278,54 +248,3 @@ EmberStatus emberAfDeactivateServerTick(EndpointId endpoint, ClusterId clusterId { return emberAfDeactivateClusterTick(endpoint, clusterId, EMBER_AF_SERVER_CLUSTER_TICK); } - -#define MS_TO_QS(ms) ((ms) >> 8) -#define MS_TO_MIN(ms) ((ms) >> 16) -#define QS_TO_MS(qs) ((qs) << 8) -#define MIN_TO_MS(min) ((min) << 16) - -// Used to calculate the duration and unit used by the host to set the sleep timer -void emAfGetTimerDurationAndUnitFromMS(uint32_t durationMs, uint16_t * duration, EmberEventUnits * units) -{ - if (durationMs <= MAX_TIMER_UNITS_HOST) - { - *duration = (uint16_t) durationMs; - *units = EMBER_EVENT_MS_TIME; - } - else if (MS_TO_QS(durationMs) <= MAX_TIMER_UNITS_HOST) - { - *duration = (uint16_t)(MS_TO_QS(durationMs)); - *units = EMBER_EVENT_QS_TIME; - } - else - { - *duration = (MS_TO_MIN(durationMs) <= MAX_TIMER_UNITS_HOST ? (uint16_t)(MS_TO_MIN(durationMs)) : MAX_TIMER_UNITS_HOST); - *units = EMBER_EVENT_MINUTE_TIME; - } -} - -uint32_t emAfGetMSFromTimerDurationAndUnit(uint16_t duration, EmberEventUnits units) -{ - uint32_t ms; - if (units == EMBER_EVENT_MS_TIME) - { - ms = duration; - } - else if (units == EMBER_EVENT_QS_TIME) - { - ms = QS_TO_MS(static_cast(duration)); - } - else if (units == EMBER_EVENT_MINUTE_TIME) - { - ms = MIN_TO_MS(static_cast(duration)); - } - else if (units == EMBER_EVENT_ZERO_DELAY) - { - ms = 0; - } - else - { - ms = UINT32_MAX; - } - return ms; -} diff --git a/src/app/util/af-event.h b/src/app/util/af-event.h index 655184af940da2..1b10e21b5887cd 100644 --- a/src/app/util/af-event.h +++ b/src/app/util/af-event.h @@ -53,18 +53,6 @@ */ typedef struct EmberEventData EmberEventData; -// A function used to retrieve the proper NCP timer duration and unit based on a given -// passed number of milliseconds. -void emAfGetTimerDurationAndUnitFromMS(uint32_t durationMs, uint16_t * duration, EmberEventUnits * units); - -// A function (inverse of the above) to retrieve the number of milliseconds -// represented by a given timer duration and unit. -uint32_t emAfGetMSFromTimerDurationAndUnit(uint16_t duration, EmberEventUnits units); - -const char * emberAfGetEventString(uint8_t index); - -void emAfInitEvents(void); - /** @brief Sets this ::EmberEventControl as inactive (no pending event). */ void emberEventControlSetInactive(EmberEventControl * control); diff --git a/src/app/util/af.h b/src/app/util/af.h index 2575116f71df13..1749168135e435 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -808,22 +808,6 @@ EmberStatus emberEventControlSetDelayMS(EmberEventControl * control, uint32_t de */ EmberStatus emberAfEventControlSetDelayQS(EmberEventControl * control, uint32_t delayQs); -/** - * @brief Sets the ::EmberEventControl to run "delayM" minutes in the future. - * The 'minutes' are actually 65536 (0x10000) milliseconds long. This function - * first verifies that the delay is within the acceptable range before - * scheduling the event. - * - * @param control a pointer to the event control. - * @param delayM the number of minutes until the next event. - * - * @return If delayM is less than or equal to - ::EMBER_MAX_EVENT_CONTROL_DELAY_MINUTES, this function will schedule - the event and return ::EMBER_SUCCESS. Otherwise it will return - ::EMBER_BAD_ARGUMENT. - */ -EmberStatus emberAfEventControlSetDelayMinutes(EmberEventControl * control, uint16_t delayM); - /** * @brief Sets the ::EmberEventControl for the current network, and only * the current network, as inactive. See ::emberEventControlSetInactive. @@ -856,12 +840,6 @@ EmberStatus emberAfNetworkEventControlSetDelay(EmberEventControl * controls, uin #else #define emberAfNetworkEventControlSetDelay(controls, delayMs) emberAfNetworkEventControlSetDelayMS(controls, delayMs); #endif -/** - * @brief Sets the ::EmberEventControl for the current network, and only the - * current network, to run "delayQs" quarter seconds in the future. See - * ::emberAfEventControlSetDelayQS. - */ -EmberStatus emberAfNetworkEventControlSetDelayQS(EmberEventControl * controls, uint32_t delayQs); /** * @brief Sets the ::EmberEventControl for the current network, and only the * current network, to run "delayM" minutes in the future. See diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 16ec51717cbe0d..54239e8e55d9d0 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -213,9 +213,6 @@ void emberAfInit(chip::Messaging::ExchangeManager * exchangeMgr) // Set up client API buffer. emberAfSetExternalBuffer(appResponseData, EMBER_AF_RESPONSE_BUFFER_LEN, &appResponseLength, &emberAfResponseApsFrame); - // initialize event management system - emAfInitEvents(); - MATTER_PLUGINS_INIT emAfCallInits(); From d593d16ab5d6f5c65745b98ac532e6ca677cf1b9 Mon Sep 17 00:00:00 2001 From: krypton36 Date: Fri, 6 May 2022 08:11:44 -0700 Subject: [PATCH 09/19] Add ability to select controller name in chip-tool-darwin (#18127) --- .../commands/common/CHIPCommandBridge.h | 11 +++++++---- .../commands/common/CHIPCommandBridge.mm | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h index 09bd93c658febb..a64ece326d28c7 100644 --- a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h +++ b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.h @@ -25,12 +25,14 @@ #pragma once +constexpr const char kIdentityAlpha[] = "alpha"; +constexpr const char kIdentityBeta[] = "beta"; +constexpr const char kIdentityGamma[] = "gamma"; + class CHIPCommandBridge : public Command { public: - CHIPCommandBridge(const char * commandName) : Command(commandName) {} - - CHIPCommandBridge(const char * commandName, CredentialIssuerCommands * credIssuerCmds) : CHIPCommandBridge(commandName) {} + CHIPCommandBridge(const char * commandName) : Command(commandName) { AddArgument("commissioner-name", &mCommissionerName); } /////////// Command Interface ///////// CHIP_ERROR Run() override; @@ -58,7 +60,7 @@ class CHIPCommandBridge : public Command // loop has been stopped. virtual void Shutdown() {} - void SetIdentity(const char * name); + void SetIdentity(const char * identity); // This method returns the commissioner instance to be used for running the command. CHIPDeviceController * CurrentCommissioner(); @@ -82,5 +84,6 @@ class CHIPCommandBridge : public Command std::condition_variable cvWaitingForResponse; std::mutex cvWaitingForResponseMutex; + chip::Optional mCommissionerName; bool mWaitingForResponse{ true }; }; diff --git a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm index 877b1cc4d1fbe7..27e90dc302f349 100644 --- a/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm +++ b/examples/chip-tool-darwin/commands/common/CHIPCommandBridge.mm @@ -53,7 +53,7 @@ ipk = [nocSigner getIPK]; - constexpr const char * identities[] = { "alpha", "beta", "gamma" }; + constexpr const char * identities[] = { kIdentityAlpha, kIdentityBeta, kIdentityGamma }; for (size_t i = 0; i < ArraySize(identities); ++i) { auto controllerParams = [[CHIPDeviceControllerStartupParams alloc] initWithKeypair:nocSigner]; controllerParams.vendorId = chip::VendorId::TestVendor1; @@ -75,8 +75,8 @@ mControllers[identities[i]] = controller; } - // Default to alpha. - SetIdentity("alpha"); + // If no commissioner name passed in, default to alpha. + SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); ReturnLogErrorOnFailure(RunCommand()); ReturnLogErrorOnFailure(StartWaiting(GetWaitDuration())); @@ -84,7 +84,16 @@ return CHIP_NO_ERROR; } -void CHIPCommandBridge::SetIdentity(const char * name) { mCurrentController = mControllers[name]; } +void CHIPCommandBridge::SetIdentity(const char * identity) +{ + std::string name = std::string(identity); + if (name.compare(kIdentityAlpha) != 0 && name.compare(kIdentityBeta) != 0 && name.compare(kIdentityGamma) != 0) { + ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", name.c_str(), kIdentityAlpha, + kIdentityBeta, kIdentityGamma); + chipDie(); + } + mCurrentController = mControllers[name]; +} CHIPDeviceController * CHIPCommandBridge::CurrentCommissioner() { return mCurrentController; } From c83eab5b325c450f3ca5c1fcd0fd969907815f95 Mon Sep 17 00:00:00 2001 From: Martin Turon Date: Fri, 6 May 2022 08:21:55 -0700 Subject: [PATCH 10/19] [build] Fix #18008 - Only build Android when ANDROID_HOME set. (#18014) --- gn_build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gn_build.sh b/gn_build.sh index d2fd46edc7d3a0..35fbb41cf23f5b 100755 --- a/gn_build.sh +++ b/gn_build.sh @@ -113,13 +113,13 @@ for arg; do user_args+=" $arg" done -# Android prebuilt JAR setup -python3 third_party/android_deps/set_up_android_deps.py - # Android SDK setup android_sdk_args="" if [[ -d "${ANDROID_NDK_HOME}/toolchains" && -d "${ANDROID_HOME}/platforms" ]]; then + # Android prebuilt JAR setup + python3 third_party/android_deps/set_up_android_deps.py + android_sdk_args+="android_sdk_root=\"$ANDROID_HOME\" android_ndk_root=\"$ANDROID_NDK_HOME\"" extra_args+=" $android_sdk_args enable_android_builds=true" else From 70dc49fd9d69f75bf28d38eee9c10cb9f82d2b1e Mon Sep 17 00:00:00 2001 From: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Date: Fri, 6 May 2022 20:54:09 +0530 Subject: [PATCH 11/19] updated CC clusters (#18023) * Added updated cc cluster * Added auto generated files * Restyled by clang-format * added update cc cluster scripts * Added Auto generated files * Restyled by clang-format * Added auto genearted file * Restyled by clang-format Co-authored-by: Restyled.io --- .../suites/certification/Test_TC_CC_3_3.yaml | 47 +- .../suites/certification/Test_TC_CC_4_3.yaml | 45 +- .../suites/certification/Test_TC_CC_7_3.yaml | 46 +- .../suites/certification/Test_TC_CC_8_1.yaml | 341 ++++- .../zap-generated/test/Commands.h | 1323 ++++++++++++++--- .../chip-tool/zap-generated/test/Commands.h | 679 +++++++-- 6 files changed, 2063 insertions(+), 418 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml index 7f9ef03a8e1482..54cb5f84db893a 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_3.yaml @@ -39,14 +39,14 @@ tests: response: value: 1 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: 150 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step hue up command" command: "StepHue" @@ -63,14 +63,23 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + #delay step is necessary to let the attribute value change over time + - label: "Wait 25ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 25 + + - label: "Over TransitionTime,Read CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step hue down command" command: "StepHue" @@ -87,14 +96,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + - label: "Wait 25ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 25 + + - label: "Over TransitionTime,Read CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml index d7e1c71994a45e..7b992ee9cd30af 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_3.yaml @@ -39,12 +39,14 @@ tests: response: value: 1 - - label: "Check Saturation attribute value matched before any change" - disabled: true + - label: "Reads CurrentSaturation attribute from DUT" command: "readAttribute" attribute: "current saturation" response: - value: 90 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step saturation up command" command: "StepSaturation" @@ -61,14 +63,23 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + #delay step is necessary to let the attribute value change over time + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Read CurrentSaturation attribute from DUT" command: "readAttribute" attribute: "current saturation" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Step saturation down command" command: "StepSaturation" @@ -85,14 +96,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Reads CurrentSaturation attribute from DUT" command: "readAttribute" attribute: "current saturation" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml index 8e1556eb3ed967..778d6dcc26436c 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_3.yaml @@ -39,14 +39,14 @@ tests: response: value: 1 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1025 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Step Hue Up command" command: "EnhancedStepHue" @@ -63,14 +63,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1075 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Step Hue Down command" command: "EnhancedStepHue" @@ -87,14 +95,22 @@ tests: - name: "optionsOverride" value: 0 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + + - label: "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1000 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml index 1831c74fa0840a..ca2197bb1dc218 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml @@ -39,156 +39,335 @@ tests: response: value: 1 - - label: "Color Loop Set Command - Set all Attributes" - command: "ColorLoopSet" + - label: "Move hue up command" + command: "MoveHue" arguments: values: - - name: "updateFlags" - value: 14 - - name: "action" - value: 0 - - name: "direction" + - name: "moveMode" value: 1 - - name: "time" - value: 100 - - name: "startHue" - value: 500 + - name: "rate" + value: 50 - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - - label: "Check ColorLoopDirection Value" + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" - attribute: "color loop direction" + attribute: "current hue" response: - value: 1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - - label: "Check ColorLoopTime Value" - command: "readAttribute" - attribute: "color loop time" - response: - value: 100 + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 - - label: "Check ColorLoopStartEnhancedHue Value" + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" - attribute: "color loop start enhanced hue" + attribute: "current hue" response: - value: 500 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - - label: "Check ColorLoopActive Value" + - label: + "Check current hue attribute value matched the value sent by the last + attribute" command: "readAttribute" - attribute: "color loop active" + attribute: "current hue" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - - label: "Color Loop Set Command - Start Color Loop" - command: "ColorLoopSet" + - label: "Move saturation up command" + command: "MoveSaturation" arguments: values: - - name: "updateFlags" + - name: "moveMode" value: 1 - - name: "action" - value: 1 - - name: "direction" - value: 0 - - name: "time" + - name: "rate" + value: 5 + - name: "optionsMask" value: 0 - - name: "startHue" + - name: "optionsOverride" value: 0 + + - label: + "Check Saturation attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - - label: "Check ColorLoopActive Value" + - label: "Reads CurrentSaturation attribute from DUT." command: "readAttribute" - attribute: "color loop active" + attribute: "current saturation" response: - value: 1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - # Test is disabled because a sleep/wait is necessary to let the hue change over time - # Once sleep/wait is available, test case will need to be adapted - - label: "Check EnhancedCurrentHue attribute value changed to a Higher Hue" - disabled: true + - label: + "Check Saturation attribute value matched the value sent by the last + attribute" command: "readAttribute" - attribute: "enhanced current hue" + attribute: "current saturation" response: - value: 500 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - - label: "Color Loop Set Command - Set direction and time while running" - command: "ColorLoopSet" + - label: "Move Color command" + command: "MoveColor" arguments: values: - - name: "updateFlags" - value: 6 - - name: "action" - value: 0 - - name: "direction" + - name: "rateX" + value: 15 + - name: "rateY" + value: 20 + - name: "optionsMask" value: 0 - - name: "time" - value: 3500 - - name: "startHue" + - name: "optionsOverride" value: 0 + + - label: "Reads CurrentX attribute from DUT" + command: "readAttribute" + attribute: "current x" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Reads CurrentY attribute from DUT" + command: "readAttribute" + attribute: "current y" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - # Test is disabled because a sleep/wait is necessary to let the hue change over time - # Once sleep/wait is available, test case will need to be adapted - - label: "Check EnhancedCurrentHue attribute value changed to a lower Hue" - disabled: true + - label: "Reads CurrentX attribute from DUT" command: "readAttribute" - attribute: "enhanced current hue" + attribute: "current x" response: - value: 500 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Check ColorLoopDirection Value" + - label: "Reads CurrentY attribute from DUT" command: "readAttribute" - attribute: "color loop direction" + attribute: "current y" response: - value: 0 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Check ColorLoopTime Value" + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: + "Check current x attribute value matched the value sent by the last + attribute" command: "readAttribute" - attribute: "color loop time" + attribute: "current x" response: - value: 3500 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: "Color Loop Set Command - Set direction while running" - command: "ColorLoopSet" + - label: + "Check current y attribute value matched the value sent by the last + attribute" + command: "readAttribute" + attribute: "current y" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Move up color temperature command" + command: "MoveColorTemperature" arguments: values: - - name: "updateFlags" - value: 2 - - name: "action" + - name: "moveMode" + value: 1 + - name: "rate" + value: 10 + - name: "colorTemperatureMinimum" + value: 1 + - name: "colorTemperatureMaximum" + value: 255 + - name: "optionsMask" + value: 0 + - name: "optionsOverride" value: 0 - - name: "direction" + + - label: "Reads current color temprature from DUT" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: + - name: "optionsMask" + value: 0 + - name: "optionsOverride" + value: 0 + + - label: "Reads current color temprature from DUT" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: + "Reads current color attribute value matched the value sent by the + last attribute" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Enhanced Move Hue Up command" + command: "EnhancedMoveHue" + arguments: + values: + - name: "moveMode" value: 1 - - name: "time" + - name: "rate" + value: 50 + - name: "optionsMask" value: 0 - - name: "startHue" + - name: "optionsOverride" value: 0 + + - label: "Reads EnhancedCurrentHue attribute value from DUT" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Stop Move Step command" + command: "StopMoveStep" + arguments: + values: - name: "optionsMask" value: 0 - name: "optionsOverride" value: 0 - # Test is disabled because a sleep/wait is necessary to let the hue change over time - # Once sleep/wait is available, test case will need to be adapted - - label: "Check EnhancedCurrentHue attribute value changed to a Higher Hue" - disabled: true + - label: "Reads EnhancedCurrentHue attribute value from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 500 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 - - label: "Check ColorLoopDirection Value" + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last attribute" command: "readAttribute" - attribute: "color loop direction" + attribute: "enhanced current hue" response: - value: 1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 7ab4601a998f21..c08e7512eecebd 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -8834,20 +8834,40 @@ class Test_TC_CC_3_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step hue up command\n"); - err = TestStepHueUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue down command\n"); - err = TestStepHueDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue up command\n"); + err = TestStepHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 25ms\n"); + err = TestWait25ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step hue down command\n"); + err = TestStepHueDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 25ms\n"); + err = TestWait25ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); break; } @@ -8881,6 +8901,21 @@ class Test_TC_CC_3_3 : public TestCommandBridge { 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; } // Go on to the next test. @@ -8894,7 +8929,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -8949,7 +8984,33 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepHueUpCommand_3() + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepHueUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8974,7 +9035,40 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepHueDownCommand_4() + CHIP_ERROR TestWait25ms_5() + { + SetIdentity("alpha"); + WaitForMs(25); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepHueDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8999,7 +9093,40 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait25ms_8() + { + SetIdentity("alpha"); + WaitForMs(25); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9017,7 +9144,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9697,20 +9824,40 @@ class Test_TC_CC_4_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step saturation up command\n"); - err = TestStepSaturationUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentSaturation attribute from DUT\n"); + err = TestReadsCurrentSaturationAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation down command\n"); - err = TestStepSaturationDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation up command\n"); + err = TestStepSaturationUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentSaturation attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step saturation down command\n"); + err = TestStepSaturationDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10ms\n"); + err = TestWait10ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Reads CurrentSaturation attribute from DUT\n"); + err = TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); break; } @@ -9744,6 +9891,21 @@ class Test_TC_CC_4_3 : public TestCommandBridge { 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; } // Go on to the next test. @@ -9757,7 +9919,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -9812,7 +9974,33 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepSaturationUpCommand_3() + CHIP_ERROR TestReadsCurrentSaturationAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepSaturationUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9837,7 +10025,40 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepSaturationDownCommand_4() + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepSaturationDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9862,7 +10083,40 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait10ms_8() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Reads CurrentSaturation attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9880,7 +10134,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12504,29 +12758,49 @@ class Test_TC_CC_7_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Step Hue Up command\n"); - err = TestEnhancedStepHueUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads EnhancedCurrentHue attribute from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Step Hue Down command\n"); - err = TestEnhancedStepHueDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Step Hue Up command\n"); + err = TestEnhancedStepHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read EnhancedCurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_6(); break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Step Hue Down command\n"); + err = TestEnhancedStepHueDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10ms\n"); + err = TestWait10ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Read EnhancedCurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); + 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) { @@ -12551,6 +12825,21 @@ class Test_TC_CC_7_3 : public TestCommandBridge { 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; } // Go on to the next test. @@ -12564,7 +12853,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -12619,7 +12908,33 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedStepHueUpCommand_3() + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedStepHueUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12644,7 +12959,40 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedStepHueDownCommand_4() + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedStepHueDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12669,7 +13017,40 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait10ms_8() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadEnhancedCurrentHueAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12687,7 +13068,7 @@ class Test_TC_CC_7_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12988,60 +13369,151 @@ class Test_TC_CC_8_1 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Color Loop Set Command - Set all Attributes\n"); - err = TestColorLoopSetCommandSetAllAttributes_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue up command\n"); + err = TestMoveHueUpCommand_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check ColorLoopStartEnhancedHue Value\n"); - err = TestCheckColorLoopStartEnhancedHueValue_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 100ms\n"); + err = TestWait100ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Color Loop Set Command - Start Color Loop\n"); - err = TestColorLoopSetCommandStartColorLoop_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current hue attribute value matched the value sent by the last attribute\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check ColorLoopActive Value\n"); - err = TestCheckColorLoopActiveValue_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Color Loop Set Command - Set direction and time while running\n"); - err = TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10(); + ChipLogProgress( + chipTool, " ***** Test Step 10 : Check Saturation attribute value matched the value sent by the last command\n"); + err = TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Check ColorLoopTime Value\n"); - err = TestCheckColorLoopTimeValue_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads CurrentSaturation attribute from DUT.\n"); + err = TestReadsCurrentSaturationAttributeFromDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Color Loop Set Command - Set direction while running\n"); - err = TestColorLoopSetCommandSetDirectionWhileRunning_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 100ms\n"); + err = TestWait100ms_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Check ColorLoopDirection Value\n"); - err = TestCheckColorLoopDirectionValue_14(); + ChipLogProgress( + chipTool, " ***** Test Step 14 : Check Saturation attribute value matched the value sent by the last attribute\n"); + err = TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastAttribute_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Move Color command\n"); + err = TestMoveColorCommand_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Reads CurrentX attribute from DUT\n"); + err = TestReadsCurrentXAttributeFromDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads CurrentY attribute from DUT\n"); + err = TestReadsCurrentYAttributeFromDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Reads CurrentX attribute from DUT\n"); + err = TestReadsCurrentXAttributeFromDut_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads CurrentY attribute from DUT\n"); + err = TestReadsCurrentYAttributeFromDut_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 100ms\n"); + err = TestWait100ms_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : Check current x attribute value matched the value sent by the last attribute\n"); + err = TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastAttribute_22(); + break; + case 23: + ChipLogProgress( + chipTool, " ***** Test Step 23 : Check current y attribute value matched the value sent by the last attribute\n"); + err = TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastAttribute_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Reads current color temprature from DUT\n"); + err = TestReadsCurrentColorTempratureFromDut_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Reads current color temprature from DUT\n"); + err = TestReadsCurrentColorTempratureFromDut_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Wait 100ms\n"); + err = TestWait100ms_28(); + break; + case 29: + ChipLogProgress(chipTool, + " ***** Test Step 29 : Reads current color attribute value matched the value sent by the last attribute\n"); + err = TestReadsCurrentColorAttributeValueMatchedTheValueSentByTheLastAttribute_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Enhanced Move Hue Up command\n"); + err = TestEnhancedMoveHueUpCommand_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Reads EnhancedCurrentHue attribute value from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeValueFromDut_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Reads EnhancedCurrentHue attribute value from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeValueFromDut_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Wait 100ms\n"); + err = TestWait100ms_34(); + break; + case 35: + ChipLogProgress(chipTool, + " ***** Test Step 35 : Check EnhancedCurrentHue attribute value matched the value sent by the last attribute\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_37(); break; } @@ -13105,6 +13577,69 @@ class Test_TC_CC_8_1 : public TestCommandBridge { 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; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -13118,7 +13653,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 38; chip::Optional mNodeId; chip::Optional mCluster; @@ -13173,26 +13708,359 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_3() + CHIP_ERROR TestMoveHueUpCommand_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:14]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:100U]; - params.startHue = [NSNumber numberWithUnsignedShort:500U]; + __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:50]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); + [cluster moveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move hue up command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_7() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationUpCommand_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentSaturationAttributeFromDut_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentSaturation attribute from DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_13() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastAttribute_14() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched the value sent by the last attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveColorCommand_15() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; + params.rateX = [NSNumber numberWithShort:15]; + params.rateY = [NSNumber numberWithShort:20]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move Color command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentXAttributeFromDut_16() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentX attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentYAttributeFromDut_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentY attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); NextTest(); }]; @@ -13200,21 +14068,24 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopDirectionValue_4() + CHIP_ERROR TestReadsCurrentXAttributeFromDut_19() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentX attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13223,21 +14094,24 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopTimeValue_5() + CHIP_ERROR TestReadsCurrentYAttributeFromDut_20() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentY attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop time", actualValue, 100U)); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13246,45 +14120,57 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopStartEnhancedHueValue_6() + CHIP_ERROR TestWait100ms_21() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastAttribute_22() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster - readAttributeColorLoopStartEnhancedHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopStartEnhancedHue Value Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched the value sent by the last attribute Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop start enhanced hue", actualValue, 500U)); - } + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopActiveValue_7() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastAttribute_23() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched the value sent by the last attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop active", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13293,48 +14179,50 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandStartColorLoop_8() + CHIP_ERROR TestMoveUpColorTemperatureCommand_24() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:1]; - params.action = [NSNumber numberWithUnsignedChar:1]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:10U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Start Color Loop Error: %@", err); + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move up color temperature command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopActiveValue_9() + CHIP_ERROR TestReadsCurrentColorTempratureFromDut_25() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopActiveWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopActive Value Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current color temprature from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop active", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13343,24 +14231,19 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandSetDirectionAndTimeWhileRunning_10() + CHIP_ERROR TestStopMoveStepCommand_26() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:6]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.time = [NSNumber numberWithUnsignedShort:3500U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params + [cluster stopMoveStepWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set direction and time while running Error: %@", err); + NSLog(@"Stop Move Step command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -13370,21 +14253,24 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopDirectionValue_11() + CHIP_ERROR TestReadsCurrentColorTempratureFromDut_27() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current color temprature from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13393,21 +14279,31 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopTimeValue_12() + CHIP_ERROR TestWait100ms_28() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentColorAttributeValueMatchedTheValueSentByTheLastAttribute_29() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopTime Value Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current color attribute value matched the value sent by the last attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop time", actualValue, 3500U)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -13416,24 +14312,69 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestColorLoopSetCommandSetDirectionWhileRunning_13() + CHIP_ERROR TestEnhancedMoveHueUpCommand_30() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterColorLoopSetParams alloc] init]; - params.updateFlags = [NSNumber numberWithUnsignedChar:2]; - params.action = [NSNumber numberWithUnsignedChar:0]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.time = [NSNumber numberWithUnsignedShort:0U]; - params.startHue = [NSNumber numberWithUnsignedShort:0U]; + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:50U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster colorLoopSetWithParams:params + [cluster enhancedMoveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move Hue Up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeValueFromDut_31() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute value from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStopMoveStepCommand_32() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stopMoveStepWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set direction while running Error: %@", err); + NSLog(@"Stop Move Step command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -13443,21 +14384,57 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckColorLoopDirectionValue_14() + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeValueFromDut_33() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeColorLoopDirectionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check ColorLoopDirection Value Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute value from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("color loop direction", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait100ms_34() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastAttribute_35() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); } NextTest(); @@ -13466,7 +14443,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_15() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_36() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -13484,7 +14461,7 @@ class Test_TC_CC_8_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_16() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_37() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 27926edda135bb..128baf07afa272 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -4796,7 +4796,7 @@ class Test_TC_CC_3_2Suite : public TestCommand class Test_TC_CC_3_3Suite : public TestCommand { public: - Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 7, credsIssuerConfig) + Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -4846,14 +4846,52 @@ class Test_TC_CC_3_3Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -4891,7 +4929,11 @@ class Test_TC_CC_3_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Step hue up command"); + LogStep(3, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 4: { + LogStep(4, "Step hue up command"); chip::app::Clusters::ColorControl::Commands::StepHue::Type value; value.stepMode = static_cast(1); value.stepSize = 5; @@ -4900,8 +4942,17 @@ class Test_TC_CC_3_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); } - case 4: { - LogStep(4, "Step hue down command"); + case 5: { + LogStep(5, "Wait 25ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(25); + } + case 6: { + LogStep(6, "Over TransitionTime,Read CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 7: { + LogStep(7, "Step hue down command"); chip::app::Clusters::ColorControl::Commands::StepHue::Type value; value.stepMode = static_cast(3); value.stepSize = 5; @@ -4910,13 +4961,22 @@ class Test_TC_CC_3_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 8: { + LogStep(8, "Wait 25ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(25); + } + case 9: { + LogStep(9, "Over TransitionTime,Read CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5222,7 +5282,7 @@ class Test_TC_CC_4_2Suite : public TestCommand class Test_TC_CC_4_3Suite : public TestCommand { public: - Test_TC_CC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_3", 7, credsIssuerConfig) + Test_TC_CC_4_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5272,14 +5332,52 @@ class Test_TC_CC_4_3Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5317,7 +5415,11 @@ class Test_TC_CC_4_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Step saturation up command"); + LogStep(3, "Reads CurrentSaturation attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 4: { + LogStep(4, "Step saturation up command"); chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; value.stepMode = static_cast(1); value.stepSize = 15; @@ -5326,8 +5428,17 @@ class Test_TC_CC_4_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value); } - case 4: { - LogStep(4, "Step saturation down command"); + case 5: { + LogStep(5, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 6: { + LogStep(6, "Over TransitionTime,Read CurrentSaturation attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 7: { + LogStep(7, "Step saturation down command"); chip::app::Clusters::ColorControl::Commands::StepSaturation::Type value; value.stepMode = static_cast(3); value.stepSize = 20; @@ -5336,13 +5447,22 @@ class Test_TC_CC_4_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepSaturation::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 8: { + LogStep(8, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 9: { + LogStep(9, "Over TransitionTime,Reads CurrentSaturation attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6646,7 +6766,7 @@ class Test_TC_CC_7_2Suite : public TestCommand class Test_TC_CC_7_3Suite : public TestCommand { public: - Test_TC_CC_7_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_3", 7, credsIssuerConfig) + Test_TC_CC_7_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6696,14 +6816,52 @@ class Test_TC_CC_7_3Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6741,7 +6899,12 @@ class Test_TC_CC_7_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Enhanced Step Hue Up command"); + LogStep(3, "Reads EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 4: { + LogStep(4, "Enhanced Step Hue Up command"); chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type value; value.stepMode = static_cast(0); value.stepSize = 50U; @@ -6751,8 +6914,18 @@ class Test_TC_CC_7_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedStepHue::Id, value); } - case 4: { - LogStep(4, "Enhanced Step Hue Down command"); + case 5: { + LogStep(5, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 6: { + LogStep(6, "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 7: { + LogStep(7, "Enhanced Step Hue Down command"); chip::app::Clusters::ColorControl::Commands::EnhancedStepHue::Type value; value.stepMode = static_cast(1); value.stepSize = 75U; @@ -6762,13 +6935,23 @@ class Test_TC_CC_7_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedStepHue::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 8: { + LogStep(8, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 9: { + LogStep(9, "Over TransitionTime,Read EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6898,7 +7081,7 @@ class Test_TC_CC_7_4Suite : public TestCommand class Test_TC_CC_8_1Suite : public TestCommand { public: - Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 17, credsIssuerConfig) + Test_TC_CC_8_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_8_1", 38, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6954,72 +7137,76 @@ class Test_TC_CC_8_1Suite : public TestCommand { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopDirection", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint16_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopTime", value, 100U)); - } break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopStartEnhancedHue", value, 500U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopActive", value, 0)); - } + shouldContinue = true; break; case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopActive", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; - case 10: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopDirection", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopTime", value, 3500U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("colorLoopDirection", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; case 15: @@ -7028,22 +7215,172 @@ class Test_TC_CC_8_1Suite : public TestCommand case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - bool value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("onOff", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + 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) @@ -7063,96 +7400,196 @@ class Test_TC_CC_8_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Color Loop Set Command - Set all Attributes"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(14); - value.action = static_cast(0); - value.direction = static_cast(1); - value.time = 100U; - value.startHue = 500U; + LogStep(3, "Move hue up command"); + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 50; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); } case 4: { - LogStep(4, "Check ColorLoopDirection Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopDirection::Id); + LogStep(4, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 5: { - LogStep(5, "Check ColorLoopTime Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id); + LogStep(5, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); } case 6: { - LogStep(6, "Check ColorLoopStartEnhancedHue Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopStartEnhancedHue::Id); + LogStep(6, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 7: { - LogStep(7, "Check ColorLoopActive Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id); + LogStep(7, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); } case 8: { - LogStep(8, "Color Loop Set Command - Start Color Loop"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); - value.action = static_cast(1); - value.direction = static_cast(0); - value.time = 0U; - value.startHue = 0U; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + LogStep(8, "Check current hue attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 9: { - LogStep(9, "Check ColorLoopActive Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopActive::Id); - } - case 10: { - LogStep(10, "Color Loop Set Command - Set direction and time while running"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(6); - value.action = static_cast(0); - value.direction = static_cast(0); - value.time = 3500U; - value.startHue = 0U; + LogStep(9, "Move saturation up command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + } + case 10: { + LogStep(10, "Check Saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); } case 11: { - LogStep(11, "Check ColorLoopDirection Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopDirection::Id); + LogStep(11, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); } case 12: { - LogStep(12, "Check ColorLoopTime Value"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorLoopTime::Id); + LogStep(12, "Reads CurrentSaturation attribute from DUT."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); } case 13: { - LogStep(13, "Color Loop Set Command - Set direction while running"); - chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); - value.action = static_cast(0); - value.direction = static_cast(1); - value.time = 0U; - value.startHue = 0U; + LogStep(13, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 14: { + LogStep(14, "Check Saturation attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 15: { + LogStep(15, "Move Color command"); + chip::app::Clusters::ColorControl::Commands::MoveColor::Type value; + value.rateX = 15; + value.rateY = 20; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::ColorLoopSet::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColor::Id, value); } - case 14: { - LogStep(14, "Check ColorLoopDirection Value"); + case 16: { + LogStep(16, "Reads CurrentX attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 17: { + LogStep(17, "Reads CurrentY attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 18: { + LogStep(18, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); + } + case 19: { + LogStep(19, "Reads CurrentX attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 20: { + LogStep(20, "Reads CurrentY attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 21: { + LogStep(21, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 22: { + LogStep(22, "Check current x attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 23: { + LogStep(23, "Check current y attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 24: { + LogStep(24, "Move up color temperature command"); + chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; + value.moveMode = static_cast(1); + value.rate = 10U; + value.colorTemperatureMinimum = 1U; + value.colorTemperatureMaximum = 255U; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, + value); + } + case 25: { + LogStep(25, "Reads current color temprature from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 26: { + LogStep(26, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); + } + case 27: { + LogStep(27, "Reads current color temprature from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 28: { + LogStep(28, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 29: { + LogStep(29, "Reads current color attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 30: { + LogStep(30, "Enhanced Move Hue Up command"); + chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 50U; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, + value); + } + case 31: { + LogStep(31, "Reads EnhancedCurrentHue attribute value from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, - ColorControl::Attributes::ColorLoopDirection::Id); + ColorControl::Attributes::EnhancedCurrentHue::Id); } - case 15: { - LogStep(15, "Turn off light that we turned on"); + case 32: { + LogStep(32, "Stop Move Step command"); + chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); + } + case 33: { + LogStep(33, "Reads EnhancedCurrentHue attribute value from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 34: { + LogStep(34, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 35: { + LogStep(35, "Check EnhancedCurrentHue attribute value matched the value sent by the last attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 36: { + LogStep(36, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 16: { - LogStep(16, "Check on/off attribute value is false after off command"); + case 37: { + LogStep(37, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } From 54a39d77b365726ef5b6ebf48c342893a1678ee0 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Fri, 6 May 2022 13:41:51 -0400 Subject: [PATCH 12/19] remove ota generation (#18152) --- scripts/examples/gn_efr32_example.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/examples/gn_efr32_example.sh b/scripts/examples/gn_efr32_example.sh index 37346facff934d..5b59d796aa3bb0 100755 --- a/scripts/examples/gn_efr32_example.sh +++ b/scripts/examples/gn_efr32_example.sh @@ -161,18 +161,4 @@ else #print stats arm-none-eabi-size -A "$BUILD_DIR"/*.out - # Generate bootloader file - if [ "${BUILD_DIR:0:2}" == "./" ]; then - BUILD_DIR_TRIMMED="${BUILD_DIR:2}" - S37_PATH=$(find "$BUILD_DIR_TRIMMED" -type f -name "*.s37") - if [ -z "$S37_PATH" ]; then - echo "Bootloader could not be built" - else - TARGET_PATH=${S37_PATH%????} - OTA_PATH="$TARGET_PATH".ota - commander gbl create "$TARGET_PATH".gbl --app "$S37_PATH" - GBL_PATH="$TARGET_PATH".gbl - ./src/app/ota_image_tool.py create -v 0xFFF1 -p 0x8005 -vn 1 -vs "1.0" -da sha256 "$GBL_PATH" "$OTA_PATH" - fi - fi fi From d6a72267de2d0bc66732605212c7346bb1bd645d Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Fri, 6 May 2022 12:44:36 -0700 Subject: [PATCH 13/19] Add Support of Authorized PAA List to the Certification Declaration Structure. (#18062) --- src/credentials/CertificationDeclaration.cpp | 126 ++++++++++++++---- src/credentials/CertificationDeclaration.h | 77 ++++++----- .../tests/TestCertificationDeclaration.cpp | 117 +++++++++++++++- 3 files changed, 265 insertions(+), 55 deletions(-) diff --git a/src/credentials/CertificationDeclaration.cpp b/src/credentials/CertificationDeclaration.cpp index 9c129f24ad831e..141191efca9e8c 100644 --- a/src/credentials/CertificationDeclaration.cpp +++ b/src/credentials/CertificationDeclaration.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2021-2022 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,6 +60,7 @@ enum kTag_CertificationType = 8, /**< [ unsigned int ] Certification Type. */ kTag_DACOriginVendorId = 9, /**< [ unsigned int, optional ] DAC origin vendor identifier. */ kTag_DACOriginProductId = 10, /**< [ unsigned int, optional ] DAC origin product identifier. */ + kTag_AuthorizedPAAList = 11, /**< [ array, optional ] Authorized PAA List. */ }; CHIP_ERROR EncodeCertificationElements(const CertificationElements & certElements, MutableByteSpan & encodedCertElements) @@ -75,7 +76,7 @@ CHIP_ERROR EncodeCertificationElements(const CertificationElements & certElement ReturnErrorOnFailure(writer.Put(ContextTag(kTag_VendorId), certElements.VendorId)); VerifyOrReturnError(certElements.ProductIdsCount > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(certElements.ProductIdsCount <= kMaxProductIdsCountPerCD, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(certElements.ProductIdsCount <= kMaxProductIdsCount, CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorOnFailure(writer.StartContainer(ContextTag(kTag_ProductIdArray), kTLVType_Array, outerContainer2)); for (uint8_t i = 0; i < certElements.ProductIdsCount; i++) @@ -95,6 +96,18 @@ CHIP_ERROR EncodeCertificationElements(const CertificationElements & certElement ReturnErrorOnFailure(writer.Put(ContextTag(kTag_DACOriginVendorId), certElements.DACOriginVendorId)); ReturnErrorOnFailure(writer.Put(ContextTag(kTag_DACOriginProductId), certElements.DACOriginProductId)); } + if (certElements.AuthorizedPAAListCount > 0) + { + VerifyOrReturnError(certElements.AuthorizedPAAListCount <= kMaxAuthorizedPAAListCount, CHIP_ERROR_INVALID_ARGUMENT); + + ReturnErrorOnFailure(writer.StartContainer(ContextTag(kTag_AuthorizedPAAList), kTLVType_Array, outerContainer2)); + for (uint8_t i = 0; i < certElements.AuthorizedPAAListCount; i++) + { + ReturnErrorOnFailure(writer.Put(AnonymousTag(), ByteSpan(certElements.AuthorizedPAAList[i]))); + } + ReturnErrorOnFailure(writer.EndContainer(outerContainer2)); + } + ReturnErrorOnFailure(writer.EndContainer(outerContainer1)); ReturnErrorOnFailure(writer.Finalize()); @@ -170,6 +183,27 @@ CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, Cer } VerifyOrReturnError(err == CHIP_END_OF_TLV || err == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT || err == CHIP_NO_ERROR, err); + if (err != CHIP_END_OF_TLV && reader.GetTag() == ContextTag(kTag_AuthorizedPAAList)) + { + VerifyOrReturnError(reader.GetType() == kTLVType_Array, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + + ReturnErrorOnFailure(reader.EnterContainer(outerContainer2)); + + certElements.AuthorizedPAAListCount = 0; + while ((err = reader.Next(kTLVType_ByteString, AnonymousTag())) == CHIP_NO_ERROR) + { + VerifyOrReturnError(reader.GetLength() == kKeyIdentifierLength, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + + ReturnErrorOnFailure( + reader.GetBytes(certElements.AuthorizedPAAList[certElements.AuthorizedPAAListCount++], kKeyIdentifierLength)); + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer2)); + + err = reader.Next(); + } + VerifyOrReturnError(err == CHIP_END_OF_TLV || err == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT || err == CHIP_NO_ERROR, err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer1)); ReturnErrorOnFailure(reader.VerifyEndOfContainer()); @@ -182,6 +216,7 @@ CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, Cer CHIP_ERROR err; TLVReader reader; TLVType outerContainer; + TLVType outerContainer2; VerifyOrReturnError(encodedCertElements.size() <= kMaxCMSSignedCDMessage, CHIP_ERROR_INVALID_ARGUMENT); @@ -198,8 +233,15 @@ CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, Cer ReturnErrorOnFailure(reader.Get(certDeclContent.vendorId)); ReturnErrorOnFailure(reader.Next(kTLVType_Array, ContextTag(kTag_ProductIdArray))); + ReturnErrorOnFailure(reader.EnterContainer(outerContainer2)); - // skip PID Array + while ((err = reader.Next(kTLVType_UnsignedInteger, AnonymousTag())) == CHIP_NO_ERROR) + { + // Verifies that the TLV structure of PID Array is correct + // but skip the values + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer2)); ReturnErrorOnFailure(reader.Next(ContextTag(kTag_DeviceTypeId))); ReturnErrorOnFailure(reader.Get(certDeclContent.deviceTypeId)); @@ -236,6 +278,28 @@ CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, Cer } VerifyOrReturnError(err == CHIP_END_OF_TLV || err == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT || err == CHIP_NO_ERROR, err); + if (err != CHIP_END_OF_TLV && reader.GetTag() == ContextTag(kTag_AuthorizedPAAList)) + { + VerifyOrReturnError(reader.GetType() == kTLVType_Array, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + + ReturnErrorOnFailure(reader.EnterContainer(outerContainer2)); + + while ((err = reader.Next(kTLVType_ByteString, AnonymousTag())) == CHIP_NO_ERROR) + { + VerifyOrReturnError(reader.GetLength() == kKeyIdentifierLength, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + // Verifies that the TLV structure of the Authorized PAA List is correct + // but skip the values + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + + ReturnErrorOnFailure(reader.ExitContainer(outerContainer2)); + + certDeclContent.authorizedPAAListPresent = true; + + err = reader.Next(); + } + VerifyOrReturnError(err == CHIP_END_OF_TLV || err == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT || err == CHIP_NO_ERROR, err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer)); ReturnErrorOnFailure(reader.VerifyEndOfContainer()); @@ -245,57 +309,73 @@ CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, Cer bool CertificationElementsDecoder::IsProductIdIn(const ByteSpan & encodedCertElements, uint16_t productId) { - VerifyOrReturnError(PrepareToReadProductIdList(encodedCertElements) == CHIP_NO_ERROR, false); + VerifyOrReturnError(FindAndEnterArray(encodedCertElements, ContextTag(kTag_ProductIdArray)) == CHIP_NO_ERROR, false); uint16_t cdProductId = 0; - CHIP_ERROR error = CHIP_NO_ERROR; - - while ((error = GetNextProductId(cdProductId)) == CHIP_NO_ERROR) + while (GetNextProductId(cdProductId) == CHIP_NO_ERROR) { if (productId == cdProductId) { return true; } } - return false; } -CHIP_ERROR CertificationElementsDecoder::PrepareToReadProductIdList(const ByteSpan & encodedCertElements) +CHIP_ERROR CertificationElementsDecoder::FindAndEnterArray(const ByteSpan & encodedCertElements, Tag arrayTag) { - mIsInitialized = false; - mCertificationDeclarationData = encodedCertElements; + TLVType outerContainerType1; + TLVType outerContainerType2; - mReader.Init(mCertificationDeclarationData); + mReader.Init(encodedCertElements); ReturnErrorOnFailure(mReader.Next(kTLVType_Structure, AnonymousTag())); - ReturnErrorOnFailure(mReader.EnterContainer(mOuterContainerType1)); + ReturnErrorOnFailure(mReader.EnterContainer(outerContainerType1)); - // position to ProductId Array + // position to arrayTag Array CHIP_ERROR error = CHIP_NO_ERROR; do { - error = mReader.Next(kTLVType_Array, ContextTag(kTag_ProductIdArray)); - // return error code if Next method returned different than CHIP_NO_ERROR. - // also return if different error code than CHIP_ERROR_WRONG_TLV_TYPE/CHIP_ERROR_UNEXPECTED_TLV_ELEMENT, which means that - // the expected type and tags do not match. - VerifyOrReturnError( - error == CHIP_NO_ERROR || error == CHIP_ERROR_WRONG_TLV_TYPE || error == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT, error); + error = mReader.Next(kTLVType_Array, arrayTag); + // Return error code unless one of three things happened: + // 1. We found the right thing (CHIP_NO_ERROR returned). + // 2. The next tag is not the one we are looking for (CHIP_ERROR_UNEXPECTED_TLV_ELEMENT). + VerifyOrReturnError(error == CHIP_NO_ERROR || error == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT, error); } while (error != CHIP_NO_ERROR); - ReturnErrorOnFailure(mReader.EnterContainer(mOuterContainerType2)); + ReturnErrorOnFailure(mReader.EnterContainer(outerContainerType2)); - mIsInitialized = true; return CHIP_NO_ERROR; } CHIP_ERROR CertificationElementsDecoder::GetNextProductId(uint16_t & productId) { - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(mReader.Next(AnonymousTag())); ReturnErrorOnFailure(mReader.Get(productId)); return CHIP_NO_ERROR; } +bool CertificationElementsDecoder::HasAuthorizedPAA(const ByteSpan & encodedCertElements, const ByteSpan & authorizedPAA) +{ + VerifyOrReturnError(FindAndEnterArray(encodedCertElements, ContextTag(kTag_AuthorizedPAAList)) == CHIP_NO_ERROR, false); + + ByteSpan cdAuthorizedPAA; + while (GetNextAuthorizedPAA(cdAuthorizedPAA) == CHIP_NO_ERROR) + { + if (authorizedPAA.data_equal(cdAuthorizedPAA)) + { + return true; + } + } + return false; +} + +CHIP_ERROR CertificationElementsDecoder::GetNextAuthorizedPAA(ByteSpan & authorizedPAA) +{ + ReturnErrorOnFailure(mReader.Next(AnonymousTag())); + ReturnErrorOnFailure(mReader.Get(authorizedPAA)); + return CHIP_NO_ERROR; +} + namespace { CHIP_ERROR EncodeEncapsulatedContent(const ByteSpan & cdContent, ASN1Writer & writer) diff --git a/src/credentials/CertificationDeclaration.h b/src/credentials/CertificationDeclaration.h index 755e1a5d50f870..5485b1c0dbe768 100644 --- a/src/credentials/CertificationDeclaration.h +++ b/src/credentials/CertificationDeclaration.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2021-2022 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +24,7 @@ #pragma once +#include #include #include #include @@ -34,40 +35,46 @@ namespace chip { namespace Credentials { -static constexpr uint32_t kMaxProductIdsCountPerCD = 100; -static constexpr uint32_t kCertificateIdLength = 19; +static constexpr uint32_t kMaxProductIdsCount = 100; +static constexpr uint32_t kMaxAuthorizedPAAListCount = 10; +static constexpr uint32_t kCertificateIdLength = 19; static constexpr uint32_t kCertificationElements_TLVEncodedMaxLength = TLV::EstimateStructOverhead(sizeof(uint16_t), // FormatVersion sizeof(uint16_t), // VendorId // ProductIds. Formally, the following extression should be used here: - // ( TLV::EstimateStructOverhead(sizeof(uint16_t)) * kMaxProductIdsCountPerCD ), + // ( TLV::EstimateStructOverhead(sizeof(uint16_t)) * kMaxProductIdsCount ), // Because exact structure of the elements of this array is known, more accurate estimate is used. - (1 + sizeof(uint16_t)) * kMaxProductIdsCountPerCD, - sizeof(uint32_t), // DeviceTypeId - kCertificateIdLength, // CertificateId - sizeof(uint8_t), // SecurityLevel - sizeof(uint16_t), // SecurityInformation - sizeof(uint16_t), // VersionNumber - sizeof(uint8_t), // CertificationType - sizeof(uint16_t), // DACOriginVendorId - sizeof(uint16_t)); // DACOriginProductId + (1 + sizeof(uint16_t)) * kMaxProductIdsCount, + sizeof(uint32_t), // DeviceTypeId + kCertificateIdLength, // CertificateId + sizeof(uint8_t), // SecurityLevel + sizeof(uint16_t), // SecurityInformation + sizeof(uint16_t), // VersionNumber + sizeof(uint8_t), // CertificationType + sizeof(uint16_t), // DACOriginVendorId + sizeof(uint16_t), // DACOriginProductId + (2 + kKeyIdentifierLength) * kMaxAuthorizedPAAListCount); // AuthorizedPAAList static constexpr uint32_t kMaxCMSSignedCDMessage = 183 + kCertificationElements_TLVEncodedMaxLength; struct CertificationElements { - uint16_t FormatVersion; - uint16_t VendorId; - uint16_t ProductIds[kMaxProductIdsCountPerCD]; - uint8_t ProductIdsCount; - uint32_t DeviceTypeId; - char CertificateId[kCertificateIdLength + 1]; - uint8_t SecurityLevel; - uint16_t SecurityInformation; - uint16_t VersionNumber; - uint8_t CertificationType; - uint16_t DACOriginVendorId; - uint16_t DACOriginProductId; - bool DACOriginVIDandPIDPresent; + typedef uint8_t KeyId[kKeyIdentifierLength]; + + uint16_t FormatVersion = 0; + uint16_t VendorId = VendorId::NotSpecified; + uint16_t ProductIds[kMaxProductIdsCount] = { 0 }; + uint8_t ProductIdsCount = 0; + uint32_t DeviceTypeId = 0; + char CertificateId[kCertificateIdLength + 1] = { 0 }; + uint8_t SecurityLevel = 0; + uint16_t SecurityInformation = 0; + uint16_t VersionNumber = 0; + uint8_t CertificationType = 0; + uint16_t DACOriginVendorId = VendorId::NotSpecified; + uint16_t DACOriginProductId = 0; + bool DACOriginVIDandPIDPresent = false; + KeyId AuthorizedPAAList[kMaxAuthorizedPAAListCount] = { { 0 } }; + uint8_t AuthorizedPAAListCount = 0; }; struct CertificationElementsWithoutPIDs @@ -82,6 +89,7 @@ struct CertificationElementsWithoutPIDs uint16_t dacOriginVendorId = VendorId::NotSpecified; uint16_t dacOriginProductId = 0; bool dacOriginVIDandPIDPresent = false; + bool authorizedPAAListPresent = false; char certificateId[kCertificateIdLength + 1] = { 0 }; }; @@ -89,16 +97,23 @@ class CertificationElementsDecoder { public: bool IsProductIdIn(const ByteSpan & encodedCertElements, uint16_t productId); + bool HasAuthorizedPAA(const ByteSpan & encodedCertElements, const ByteSpan & authorizedPAA); private: - CHIP_ERROR PrepareToReadProductIdList(const ByteSpan & encodedCertElements); + /** + * @brief Positions mReader inside at the top of an Array with listTag tag. + * + * @param[in] encodedCertElements TLV encoded structure of CD elements. + * @param[in] listTag A tag of an array to be found in the encodedCertElements TLV structure. + * + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ + CHIP_ERROR FindAndEnterArray(const ByteSpan & encodedCertElements, TLV::Tag listTag); + CHIP_ERROR GetNextProductId(uint16_t & productId); + CHIP_ERROR GetNextAuthorizedPAA(ByteSpan & authorizedPAA); - ByteSpan mCertificationDeclarationData; - bool mIsInitialized = false; TLV::TLVReader mReader; - TLV::TLVType mOuterContainerType1 = TLV::kTLVType_Structure; - TLV::TLVType mOuterContainerType2 = TLV::kTLVType_Structure; }; /** diff --git a/src/credentials/tests/TestCertificationDeclaration.cpp b/src/credentials/tests/TestCertificationDeclaration.cpp index 3d15f39f2ea02e..cda5f90b05124e 100644 --- a/src/credentials/tests/TestCertificationDeclaration.cpp +++ b/src/credentials/tests/TestCertificationDeclaration.cpp @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2021-2022 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -203,6 +203,13 @@ static void TestCD_EncodeDecode(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, decodedElements.DACOriginVendorId == testCase.cdElements.DACOriginVendorId); NL_TEST_ASSERT(inSuite, decodedElements.DACOriginProductId == testCase.cdElements.DACOriginProductId); } + NL_TEST_ASSERT(inSuite, decodedElements.AuthorizedPAAListCount == testCase.cdElements.AuthorizedPAAListCount); + for (uint8_t j = 0; j < decodedElements.AuthorizedPAAListCount; j++) + { + NL_TEST_ASSERT( + inSuite, + memcmp(decodedElements.AuthorizedPAAList[j], testCase.cdElements.AuthorizedPAAList[j], kKeyIdentifierLength) == 0); + } } } @@ -347,6 +354,113 @@ static void TestCD_CertificationElementsDecoder(nlTestSuite * inSuite, void * in NL_TEST_ASSERT(inSuite, certificationDeclarationContent.dacOriginVendorId == testCase.cdElements.DACOriginVendorId); NL_TEST_ASSERT(inSuite, certificationDeclarationContent.dacOriginProductId == testCase.cdElements.DACOriginProductId); } + if (testCase.cdElements.AuthorizedPAAListCount > 0) + { + NL_TEST_ASSERT(inSuite, certificationDeclarationContent.authorizedPAAListPresent); + } + else + { + NL_TEST_ASSERT(inSuite, !certificationDeclarationContent.authorizedPAAListPresent); + } + } +} + +static void TestCD_EncodeDecode_Random(nlTestSuite * inSuite, void * inContext) +{ + CertificationElements randomElements = { .FormatVersion = 0x6F, + .VendorId = 0x88EA, + .ProductIds = { 0 }, + .ProductIdsCount = kMaxProductIdsCount, + .DeviceTypeId = 0x1234, + .CertificateId = "ZIG20141ZB330001-24", + .SecurityLevel = 10, + .SecurityInformation = 0xFA, + .VersionNumber = 0x28CA, + .CertificationType = 1, + .DACOriginVendorId = 0x01DC, + .DACOriginProductId = 0x10EE, + .DACOriginVIDandPIDPresent = false, + .AuthorizedPAAList = { { 0 } }, + .AuthorizedPAAListCount = kMaxAuthorizedPAAListCount }; + + uint16_t pid = 0x8000; + for (uint8_t j = 0; j < randomElements.ProductIdsCount; j++, pid++) + { + randomElements.ProductIds[j] = pid; + } + uint8_t kid[kKeyIdentifierLength] = { 0xF4, 0x44, 0xCA, 0xBB, 0xC5, 0x01, 0x65, 0x77, 0xAA, 0x8B, + 0x44, 0xFF, 0xB9, 0x0F, 0xCC, 0xA1, 0x40, 0xFE, 0x66, 0x20 }; + for (uint8_t j = 0; j < randomElements.AuthorizedPAAListCount; j++) + { + kid[(j % kKeyIdentifierLength)] ^= 0xFF; + memcpy(randomElements.AuthorizedPAAList[j], kid, kKeyIdentifierLength); + } + + uint8_t encodedCertElemBuf[kCertificationElements_TLVEncodedMaxLength]; + MutableByteSpan encodedCDPayload(encodedCertElemBuf); + CertificationElements decodedElements; + + NL_TEST_ASSERT(inSuite, EncodeCertificationElements(randomElements, encodedCDPayload) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, DecodeCertificationElements(encodedCDPayload, decodedElements) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, decodedElements.FormatVersion == randomElements.FormatVersion); + NL_TEST_ASSERT(inSuite, decodedElements.VendorId == randomElements.VendorId); + NL_TEST_ASSERT(inSuite, decodedElements.ProductIdsCount == randomElements.ProductIdsCount); + for (uint8_t j = 0; j < decodedElements.ProductIdsCount; j++) + { + NL_TEST_ASSERT(inSuite, decodedElements.ProductIds[j] == randomElements.ProductIds[j]); + } + NL_TEST_ASSERT(inSuite, decodedElements.DeviceTypeId == randomElements.DeviceTypeId); + NL_TEST_ASSERT(inSuite, memcmp(decodedElements.CertificateId, randomElements.CertificateId, kCertificateIdLength) == 0); + NL_TEST_ASSERT(inSuite, decodedElements.SecurityLevel == randomElements.SecurityLevel); + NL_TEST_ASSERT(inSuite, decodedElements.SecurityInformation == randomElements.SecurityInformation); + NL_TEST_ASSERT(inSuite, decodedElements.VersionNumber == randomElements.VersionNumber); + NL_TEST_ASSERT(inSuite, decodedElements.CertificationType == randomElements.CertificationType); + NL_TEST_ASSERT(inSuite, decodedElements.DACOriginVIDandPIDPresent == randomElements.DACOriginVIDandPIDPresent); + if (decodedElements.DACOriginVIDandPIDPresent) + { + NL_TEST_ASSERT(inSuite, decodedElements.DACOriginVendorId == randomElements.DACOriginVendorId); + NL_TEST_ASSERT(inSuite, decodedElements.DACOriginProductId == randomElements.DACOriginProductId); + } + NL_TEST_ASSERT(inSuite, decodedElements.AuthorizedPAAListCount == randomElements.AuthorizedPAAListCount); + for (uint8_t j = 0; j < decodedElements.AuthorizedPAAListCount; j++) + { + NL_TEST_ASSERT( + inSuite, memcmp(decodedElements.AuthorizedPAAList[j], randomElements.AuthorizedPAAList[j], kKeyIdentifierLength) == 0); + } + + CertificationElementsWithoutPIDs decodedElements2; + CertificationElementsDecoder cdElementsDecoder; + NL_TEST_ASSERT(inSuite, DecodeCertificationElements(encodedCDPayload, decodedElements2) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, decodedElements2.formatVersion == randomElements.FormatVersion); + NL_TEST_ASSERT(inSuite, decodedElements2.vendorId == randomElements.VendorId); + for (uint8_t j = 0; j < randomElements.ProductIdsCount; j++) + { + NL_TEST_ASSERT(inSuite, cdElementsDecoder.IsProductIdIn(encodedCDPayload, randomElements.ProductIds[j])); + // now test for an unexistent ProductId + NL_TEST_ASSERT(inSuite, cdElementsDecoder.IsProductIdIn(encodedCDPayload, pid++) == false); + } + NL_TEST_ASSERT(inSuite, decodedElements2.deviceTypeId == randomElements.DeviceTypeId); + NL_TEST_ASSERT(inSuite, memcmp(decodedElements2.certificateId, randomElements.CertificateId, kCertificateIdLength) == 0); + NL_TEST_ASSERT(inSuite, decodedElements2.securityLevel == randomElements.SecurityLevel); + NL_TEST_ASSERT(inSuite, decodedElements2.securityInformation == randomElements.SecurityInformation); + NL_TEST_ASSERT(inSuite, decodedElements2.versionNumber == randomElements.VersionNumber); + NL_TEST_ASSERT(inSuite, decodedElements2.certificationType == randomElements.CertificationType); + NL_TEST_ASSERT(inSuite, decodedElements2.dacOriginVIDandPIDPresent == randomElements.DACOriginVIDandPIDPresent); + if (decodedElements2.dacOriginVIDandPIDPresent) + { + NL_TEST_ASSERT(inSuite, decodedElements2.dacOriginVendorId == randomElements.DACOriginVendorId); + NL_TEST_ASSERT(inSuite, decodedElements2.dacOriginProductId == randomElements.DACOriginProductId); + } + NL_TEST_ASSERT(inSuite, decodedElements2.authorizedPAAListPresent); + for (uint8_t j = 0; j < randomElements.AuthorizedPAAListCount; j++) + { + NL_TEST_ASSERT(inSuite, + cdElementsDecoder.HasAuthorizedPAA(encodedCDPayload, ByteSpan(randomElements.AuthorizedPAAList[j]))); + // now test for an unexistent PAA + kid[(kKeyIdentifierLength - 1 - j) % kKeyIdentifierLength] ^= 0x5A; + NL_TEST_ASSERT(inSuite, cdElementsDecoder.HasAuthorizedPAA(encodedCDPayload, ByteSpan(kid)) == false); } } @@ -359,6 +473,7 @@ static const nlTest sTests[] = { NL_TEST_DEF_FN(TestCD_EncodeDecode), NL_TEST_DEF_FN(TestCD_CMSSignAndVerify), NL_TEST_DEF_FN(TestCD_CMSVerifyAndExtract), NL_TEST_DEF_FN(TestCD_CertificationElementsDecoder), + NL_TEST_DEF_FN(TestCD_EncodeDecode_Random), NL_TEST_SENTINEL() }; int TestCertificationDeclaration(void) From bea994b57e111a41894693230353748aaa8c9cc8 Mon Sep 17 00:00:00 2001 From: seb-fae <71495014+seb-fae@users.noreply.github.com> Date: Fri, 6 May 2022 22:29:19 +0200 Subject: [PATCH 14/19] Add group and scene clusters (#18141) * Add group and scene clusters * Restyled by whitespace * Restyled by clang-format * Zap regen (#18153) * Add group and scene clusters * Restyled by whitespace * Restyled by clang-format * Rebase * Fix Merging error Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- examples/window-app/common/window-app.matter | 172 ++++++++ examples/window-app/common/window-app.zap | 402 ++++++++++++++++-- .../zap-generated/CHIPClientCallbacks.h | 4 + .../window-app/zap-generated/CHIPClusters.h | 7 + .../zap-generated/IMClusterCommandHandler.cpp | 85 ++++ .../PluginApplicationCallbacks.h | 2 + .../window-app/zap-generated/access.h | 12 + .../zap-generated/callback-stub.cpp | 16 + .../zap-generated/endpoint_config.h | 107 ++++- .../window-app/zap-generated/gen_config.h | 11 + 10 files changed, 765 insertions(+), 53 deletions(-) diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 250799bf162b82..17f8a11a61dd4d 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -428,6 +428,61 @@ server cluster GroupKeyManagement = 63 { command access(invoke: administer) KeySetReadAllIndices(KeySetReadAllIndicesRequest): KeySetReadAllIndicesResponse = 4; } +server cluster Groups = 4 { + readonly attribute bitmap8 nameSupport = 0; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupId = 0; + CHAR_STRING groupName = 1; + } + + request struct ViewGroupRequest { + group_id groupId = 0; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + request struct RemoveGroupRequest { + group_id groupId = 0; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupId = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupId = 1; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupId = 1; + CHAR_STRING groupName = 2; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupId = 1; + } + + command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { kBlink = 0; @@ -944,6 +999,111 @@ server cluster PowerSource = 47 { readonly attribute int16u clusterRevision = 65533; } +client cluster Scenes = 5 { + bitmap ScenesCopyMode : BITMAP8 { + kCopyAllScenes = 0x1; + } + + struct SceneExtensionFieldSet { + CLUSTER_ID clusterId = 0; + INT8U length = 1; + INT8U value = 2; + } + + readonly attribute int8u sceneCount = 0; + readonly attribute int8u currentScene = 1; + readonly attribute int16u currentGroup = 2; + readonly attribute boolean sceneValid = 3; + readonly attribute bitmap8 nameSupport = 4; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute int16u clusterRevision = 65533; + + request struct AddSceneRequest { + INT16U groupId = 0; + INT8U sceneId = 1; + INT16U transitionTime = 2; + CHAR_STRING sceneName = 3; + SceneExtensionFieldSet extensionFieldSets[] = 4; + } + + request struct ViewSceneRequest { + INT16U groupId = 0; + INT8U sceneId = 1; + } + + request struct RemoveSceneRequest { + INT16U groupId = 0; + INT8U sceneId = 1; + } + + request struct RemoveAllScenesRequest { + INT16U groupId = 0; + } + + request struct StoreSceneRequest { + INT16U groupId = 0; + INT8U sceneId = 1; + } + + request struct RecallSceneRequest { + INT16U groupId = 0; + INT8U sceneId = 1; + INT16U transitionTime = 2; + } + + request struct GetSceneMembershipRequest { + INT16U groupId = 0; + } + + response struct AddSceneResponse = 0 { + ENUM8 status = 0; + INT16U groupId = 1; + INT8U sceneId = 2; + } + + response struct ViewSceneResponse = 1 { + ENUM8 status = 0; + INT16U groupId = 1; + INT8U sceneId = 2; + INT16U transitionTime = 3; + CHAR_STRING sceneName = 4; + SceneExtensionFieldSet extensionFieldSets[] = 5; + } + + response struct RemoveSceneResponse = 2 { + ENUM8 status = 0; + INT16U groupId = 1; + INT8U sceneId = 2; + } + + response struct RemoveAllScenesResponse = 3 { + ENUM8 status = 0; + INT16U groupId = 1; + } + + response struct StoreSceneResponse = 4 { + ENUM8 status = 0; + INT16U groupId = 1; + INT8U sceneId = 2; + } + + response struct GetSceneMembershipResponse = 6 { + ENUM8 status = 0; + INT8U capacity = 1; + INT16U groupId = 2; + INT8U sceneCount = 3; + INT8U sceneList[] = 4; + } + + command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; + command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; + command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; + command access(invoke: manage) RemoveAllScenes(RemoveAllScenesRequest): RemoveAllScenesResponse = 3; + command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; + command RecallScene(RecallSceneRequest): DefaultSuccess = 5; + command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; +} + server cluster SoftwareDiagnostics = 52 { struct ThreadMetrics { INT64U id = 0; @@ -1672,6 +1832,7 @@ endpoint 0 { } endpoint 1 { + binding cluster Scenes; server cluster Identify { ram attribute identifyTime; @@ -1679,6 +1840,11 @@ endpoint 1 { ram attribute clusterRevision default = 4; } + server cluster Groups { + ram attribute nameSupport; + ram attribute clusterRevision default = 4; + } + server cluster Descriptor { callback attribute deviceList; callback attribute serverList; @@ -1712,6 +1878,12 @@ endpoint 1 { } endpoint 2 { + binding cluster Scenes; + + server cluster Groups { + ram attribute nameSupport; + ram attribute clusterRevision default = 4; + } server cluster Descriptor { callback attribute deviceList; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index a310c30b584772..574f302f2ef0de 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -5908,7 +5908,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "ViewGroup", @@ -5916,7 +5916,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "GetGroupMembership", @@ -5924,7 +5924,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveGroup", @@ -5932,7 +5932,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveAllGroups", @@ -5940,7 +5940,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "AddGroupIfIdentifying", @@ -5948,10 +5948,25 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -5975,7 +5990,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddGroupResponse", @@ -6026,6 +6041,66 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6049,7 +6124,7 @@ "mfgCode": null, "define": "SCENES_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddScene", @@ -6057,7 +6132,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "ViewScene", @@ -6065,7 +6140,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveScene", @@ -6073,7 +6148,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveAllScenes", @@ -6081,7 +6156,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "StoreScene", @@ -6089,7 +6164,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RecallScene", @@ -6097,7 +6172,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "GetSceneMembership", @@ -6105,10 +6180,49 @@ "mfgCode": null, "source": "client", "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6139,7 +6253,7 @@ "code": 0, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -6147,7 +6261,7 @@ "code": 1, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -6155,7 +6269,7 @@ "code": 2, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -6163,7 +6277,7 @@ "code": 3, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -6171,7 +6285,7 @@ "code": 4, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -6179,7 +6293,7 @@ "code": 6, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 } ], @@ -6259,6 +6373,51 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "last configured by", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "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", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8349,7 +8508,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "ViewGroup", @@ -8357,7 +8516,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "GetGroupMembership", @@ -8365,7 +8524,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveGroup", @@ -8373,7 +8532,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveAllGroups", @@ -8381,7 +8540,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "AddGroupIfIdentifying", @@ -8389,10 +8548,25 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8416,7 +8590,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddGroupResponse", @@ -8467,6 +8641,66 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8490,7 +8724,7 @@ "mfgCode": null, "define": "SCENES_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AddScene", @@ -8498,7 +8732,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "ViewScene", @@ -8506,7 +8740,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveScene", @@ -8514,7 +8748,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveAllScenes", @@ -8522,7 +8756,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "StoreScene", @@ -8530,7 +8764,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RecallScene", @@ -8538,7 +8772,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "GetSceneMembership", @@ -8546,10 +8780,49 @@ "mfgCode": null, "source": "client", "incoming": 1, + "outgoing": 1 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, "outgoing": 0 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8580,7 +8853,7 @@ "code": 0, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -8588,7 +8861,7 @@ "code": 1, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -8596,7 +8869,7 @@ "code": 2, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -8604,7 +8877,7 @@ "code": 3, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -8612,7 +8885,7 @@ "code": 4, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 }, { @@ -8620,7 +8893,7 @@ "code": 6, "mfgCode": null, "source": "server", - "incoming": 0, + "incoming": 1, "outgoing": 1 } ], @@ -8661,7 +8934,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "NVM", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", @@ -8700,6 +8973,51 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "last configured by", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "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", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9607,4 +9925,4 @@ "deviceIdentifier": 514 } ] -} \ No newline at end of file +} diff --git a/zzz_generated/window-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/window-app/zap-generated/CHIPClientCallbacks.h index 7ce7f6e003bd31..8c331715b6fef3 100644 --- a/zzz_generated/window-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/window-app/zap-generated/CHIPClientCallbacks.h @@ -31,3 +31,7 @@ #include // List specific responses +void ScenesClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ScenesAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); diff --git a/zzz_generated/window-app/zap-generated/CHIPClusters.h b/zzz_generated/window-app/zap-generated/CHIPClusters.h index 15ec5aca34a215..5c2df48044289f 100644 --- a/zzz_generated/window-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/window-app/zap-generated/CHIPClusters.h @@ -37,5 +37,12 @@ class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase ~OtaSoftwareUpdateProviderCluster() {} }; +class DLL_EXPORT ScenesCluster : public ClusterBase +{ +public: + ScenesCluster() : ClusterBase(app::Clusters::Scenes::Id) {} + ~ScenesCluster() {} +}; + } // namespace Controller } // namespace chip diff --git a/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp index aedba5c104cfd0..713653ffc1858b 100644 --- a/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/window-app/zap-generated/IMClusterCommandHandler.cpp @@ -219,6 +219,88 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace GroupKeyManagement +namespace Groups { + +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::AddGroup::Id: { + Commands::AddGroup::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupsClusterAddGroupCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::ViewGroup::Id: { + Commands::ViewGroup::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupsClusterViewGroupCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::GetGroupMembership::Id: { + Commands::GetGroupMembership::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupsClusterGetGroupMembershipCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveGroup::Id: { + Commands::RemoveGroup::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupsClusterRemoveGroupCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::RemoveAllGroups::Id: { + Commands::RemoveAllGroups::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupsClusterRemoveAllGroupsCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::AddGroupIfIdentifying::Id: { + Commands::AddGroupIfIdentifying::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupsClusterAddGroupIfIdentifyingCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || !wasHandled) + { + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); + ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); + } +} + +} // namespace Groups + namespace Identify { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -691,6 +773,9 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::GroupKeyManagement::Id: Clusters::GroupKeyManagement::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::Groups::Id: + Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::Identify::Id: Clusters::Identify::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/window-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/window-app/zap-generated/PluginApplicationCallbacks.h index cf79e2079194e7..87eeac9caaeb85 100644 --- a/zzz_generated/window-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/window-app/zap-generated/PluginApplicationCallbacks.h @@ -31,6 +31,7 @@ MatterGeneralCommissioningPluginServerInitCallback(); \ MatterGeneralDiagnosticsPluginServerInitCallback(); \ MatterGroupKeyManagementPluginServerInitCallback(); \ + MatterGroupsPluginServerInitCallback(); \ MatterIdentifyPluginServerInitCallback(); \ MatterLocalizationConfigurationPluginServerInitCallback(); \ MatterNetworkCommissioningPluginServerInitCallback(); \ @@ -38,6 +39,7 @@ MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterPowerSourcePluginServerInitCallback(); \ + MatterScenesPluginClientInitCallback(); \ MatterSoftwareDiagnosticsPluginServerInitCallback(); \ MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ MatterTimeFormatLocalizationPluginServerInitCallback(); \ diff --git a/zzz_generated/window-app/zap-generated/access.h b/zzz_generated/window-app/zap-generated/access.h index 4d145487116d31..7acdd2a764f453 100644 --- a/zzz_generated/window-app/zap-generated/access.h +++ b/zzz_generated/window-app/zap-generated/access.h @@ -154,6 +154,10 @@ 63, /* Cluster: Group Key Management, Command: KeySetRead, Privilege: administer */ \ 63, /* Cluster: Group Key Management, Command: KeySetRemove, Privilege: administer */ \ 63, /* Cluster: Group Key Management, Command: KeySetReadAllIndices, Privilege: administer */ \ + 4, /* Cluster: Groups, Command: AddGroup, Privilege: manage */ \ + 4, /* Cluster: Groups, Command: RemoveGroup, Privilege: manage */ \ + 4, /* Cluster: Groups, Command: RemoveAllGroups, Privilege: manage */ \ + 4, /* Cluster: Groups, Command: AddGroupIfIdentifying, Privilege: manage */ \ 3, /* Cluster: Identify, Command: Identify, Privilege: manage */ \ 3, /* Cluster: Identify, Command: IdentifyQuery, Privilege: manage */ \ 3, /* Cluster: Identify, Command: TriggerEffect, Privilege: manage */ \ @@ -186,6 +190,10 @@ 1, /* Cluster: Group Key Management, Command: KeySetRead, Privilege: administer */ \ 3, /* Cluster: Group Key Management, Command: KeySetRemove, Privilege: administer */ \ 4, /* Cluster: Group Key Management, Command: KeySetReadAllIndices, Privilege: administer */ \ + 0, /* Cluster: Groups, Command: AddGroup, Privilege: manage */ \ + 3, /* Cluster: Groups, Command: RemoveGroup, Privilege: manage */ \ + 4, /* Cluster: Groups, Command: RemoveAllGroups, Privilege: manage */ \ + 5, /* Cluster: Groups, Command: AddGroupIfIdentifying, Privilege: manage */ \ 0, /* Cluster: Identify, Command: Identify, Privilege: manage */ \ 1, /* Cluster: Identify, Command: IdentifyQuery, Privilege: manage */ \ 64, /* Cluster: Identify, Command: TriggerEffect, Privilege: manage */ \ @@ -218,6 +226,10 @@ kMatterAccessPrivilegeAdminister, /* Cluster: Group Key Management, Command: KeySetRead, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Group Key Management, Command: KeySetRemove, Privilege: administer */ \ kMatterAccessPrivilegeAdminister, /* Cluster: Group Key Management, Command: KeySetReadAllIndices, Privilege: administer */ \ + kMatterAccessPrivilegeManage, /* Cluster: Groups, Command: AddGroup, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Groups, Command: RemoveGroup, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Groups, Command: RemoveAllGroups, Privilege: manage */ \ + kMatterAccessPrivilegeManage, /* Cluster: Groups, Command: AddGroupIfIdentifying, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Identify, Command: Identify, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Identify, Command: IdentifyQuery, Privilege: manage */ \ kMatterAccessPrivilegeManage, /* Cluster: Identify, Command: TriggerEffect, Privilege: manage */ \ diff --git a/zzz_generated/window-app/zap-generated/callback-stub.cpp b/zzz_generated/window-app/zap-generated/callback-stub.cpp index 379b9954ed42e7..4f583b0d46ac58 100644 --- a/zzz_generated/window-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/window-app/zap-generated/callback-stub.cpp @@ -56,6 +56,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: emberAfGroupKeyManagementClusterInitCallback(endpoint); break; + case ZCL_GROUPS_CLUSTER_ID: + emberAfGroupsClusterInitCallback(endpoint); + break; case ZCL_IDENTIFY_CLUSTER_ID: emberAfIdentifyClusterInitCallback(endpoint); break; @@ -77,6 +80,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_POWER_SOURCE_CLUSTER_ID: emberAfPowerSourceClusterInitCallback(endpoint); break; + case ZCL_SCENES_CLUSTER_ID: + emberAfScenesClusterInitCallback(endpoint); + break; case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; @@ -149,6 +155,11 @@ void __attribute__((weak)) emberAfGroupKeyManagementClusterInitCallback(Endpoint // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfGroupsClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfIdentifyClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -184,6 +195,11 @@ void __attribute__((weak)) emberAfPowerSourceClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 0a51735dffb4cf..62001fb7e0b3ec 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -459,7 +459,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 252 +#define GENERATED_ATTRIBUTE_COUNT 256 #define GENERATED_ATTRIBUTES \ { \ \ @@ -769,6 +769,10 @@ { 0x00000001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* identify type */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + { 0x00000000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* name support */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ + \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ @@ -812,6 +816,10 @@ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(243) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ + /* Endpoint: 2, Cluster: Groups (server) */ \ + { 0x00000000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* name support */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ + \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x00000000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ { 0x00000001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* server list */ \ @@ -878,6 +886,9 @@ (EmberAfGenericClusterFunction) emberAfIdentifyClusterServerInitCallback, \ (EmberAfGenericClusterFunction) MatterIdentifyClusterServerAttributeChangedCallback, \ }; \ + const EmberAfGenericClusterFunction chipFuncArrayGroupsServer[] = { \ + (EmberAfGenericClusterFunction) emberAfGroupsClusterServerInitCallback, \ + }; \ const EmberAfGenericClusterFunction chipFuncArrayWindowCoveringServer[] = { \ (EmberAfGenericClusterFunction) MatterWindowCoveringClusterServerAttributeChangedCallback, \ }; @@ -967,6 +978,21 @@ /* server_generated */ \ 0x00000000 /* IdentifyQueryResponse */, \ chip::kInvalidCommandId /* end of list */, \ + /* Endpoint: 1, Cluster: Groups (server) */\ + /* client_generated */ \ + 0x00000000 /* AddGroup */, \ + 0x00000001 /* ViewGroup */, \ + 0x00000002 /* GetGroupMembership */, \ + 0x00000003 /* RemoveGroup */, \ + 0x00000004 /* RemoveAllGroups */, \ + 0x00000005 /* AddGroupIfIdentifying */, \ + chip::kInvalidCommandId /* end of list */, \ + /* server_generated */ \ + 0x00000000 /* AddGroupResponse */, \ + 0x00000001 /* ViewGroupResponse */, \ + 0x00000002 /* GetGroupMembershipResponse */, \ + 0x00000003 /* RemoveGroupResponse */, \ + chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Window Covering (server) */\ /* client_generated */ \ 0x00000000 /* UpOrOpen */, \ @@ -977,6 +1003,21 @@ 0x00000007 /* GoToTiltValue */, \ 0x00000008 /* GoToTiltPercentage */, \ chip::kInvalidCommandId /* end of list */, \ + /* Endpoint: 2, Cluster: Groups (server) */\ + /* client_generated */ \ + 0x00000000 /* AddGroup */, \ + 0x00000001 /* ViewGroup */, \ + 0x00000002 /* GetGroupMembership */, \ + 0x00000003 /* RemoveGroup */, \ + 0x00000004 /* RemoveAllGroups */, \ + 0x00000005 /* AddGroupIfIdentifying */, \ + chip::kInvalidCommandId /* end of list */, \ + /* server_generated */ \ + 0x00000000 /* AddGroupResponse */, \ + 0x00000001 /* ViewGroupResponse */, \ + 0x00000002 /* GetGroupMembershipResponse */, \ + 0x00000003 /* RemoveGroupResponse */, \ + chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Window Covering (server) */\ /* client_generated */ \ 0x00000000 /* UpOrOpen */, \ @@ -992,7 +1033,7 @@ // clang-format on #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 26 +#define GENERATED_CLUSTER_COUNT 30 // clang-format off #define GENERATED_CLUSTERS { \ @@ -1238,10 +1279,32 @@ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 52 ) ,\ .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 56 ) ,\ },\ + { \ + /* Endpoint: 1, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ) ,\ + },\ + { \ + /* Endpoint: 1, Cluster: Scenes (client) */ \ + .clusterId = 0x00000005, \ + .attributes = ZAP_ATTRIBUTE_INDEX(204), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr ,\ + .generatedCommandList = nullptr ,\ + },\ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(202), \ + .attributes = ZAP_ATTRIBUTE_INDEX(204), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1252,18 +1315,40 @@ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(207), \ + .attributes = ZAP_ATTRIBUTE_INDEX(209), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 58 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 70 ) ,\ + .generatedCommandList = nullptr ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Groups (server) */ \ + .clusterId = 0x00000004, \ + .attributes = ZAP_ATTRIBUTE_INDEX(229), \ + .attributeCount = 2, \ + .clusterSize = 3, \ + .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ + .functions = chipFuncArrayGroupsServer, \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 78 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 85 ) ,\ + },\ + { \ + /* Endpoint: 2, Cluster: Scenes (client) */ \ + .clusterId = 0x00000005, \ + .attributes = ZAP_ATTRIBUTE_INDEX(231), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .acceptedCommandList = nullptr ,\ .generatedCommandList = nullptr ,\ },\ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(227), \ + .attributes = ZAP_ATTRIBUTE_INDEX(231), \ .attributeCount = 5, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -1274,12 +1359,12 @@ { \ /* Endpoint: 2, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(232), \ + .attributes = ZAP_ATTRIBUTE_INDEX(236), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 66 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 90 ) ,\ .generatedCommandList = nullptr ,\ },\ } @@ -1288,12 +1373,12 @@ #define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index]) -#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT 25 +#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT 27 // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 21, 511 }, { ZAP_CLUSTER_INDEX(21), 3, 40 }, { ZAP_CLUSTER_INDEX(24), 2, 35 }, \ + { ZAP_CLUSTER_INDEX(0), 21, 511 }, { ZAP_CLUSTER_INDEX(21), 5, 43 }, { ZAP_CLUSTER_INDEX(26), 4, 38 }, \ } // Largest attribute size is needed for various buffers @@ -1305,7 +1390,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (37) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (586) +#define ATTRIBUTE_MAX_SIZE (592) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/window-app/zap-generated/gen_config.h b/zzz_generated/window-app/zap-generated/gen_config.h index 46a40f8fd5e470..c76ec654299b00 100644 --- a/zzz_generated/window-app/zap-generated/gen_config.h +++ b/zzz_generated/window-app/zap-generated/gen_config.h @@ -38,6 +38,7 @@ #define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GENERAL_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_LOCALIZATION_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -45,6 +46,7 @@ #define EMBER_AF_OTA_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_SCENES_CLUSTER_CLIENT_ENDPOINT_COUNT (2) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TIME_FORMAT_LOCALIZATION_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -100,6 +102,11 @@ #define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT_SERVER #define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT +// Use this macro to check if the server side of the Groups cluster is included +#define ZCL_USING_GROUPS_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_GROUPS_SERVER +#define EMBER_AF_PLUGIN_GROUPS + // Use this macro to check if the server side of the Identify cluster is included #define ZCL_USING_IDENTIFY_CLUSTER_SERVER #define EMBER_AF_PLUGIN_IDENTIFY_SERVER @@ -134,6 +141,10 @@ #define EMBER_AF_PLUGIN_POWER_SOURCE_SERVER #define EMBER_AF_PLUGIN_POWER_SOURCE +// Use this macro to check if the client side of the Scenes cluster is included +#define ZCL_USING_SCENES_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_SCENES_CLIENT + // Use this macro to check if the server side of the Software Diagnostics cluster is included #define ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER From 2d770297338199b4967cd7797d837c2bf8206d3c Mon Sep 17 00:00:00 2001 From: kowsisoundhar12 <57476670+kowsisoundhar12@users.noreply.github.com> Date: Sat, 7 May 2022 04:06:03 +0530 Subject: [PATCH 15/19] Updated CC cluster Scripts (#17957) * Added update cc cluster scripts * Added Auto generated files * Restyled by clang-format Co-authored-by: Restyled.io --- .../suites/certification/Test_TC_CC_3_1.yaml | 210 +- .../suites/certification/Test_TC_CC_3_2.yaml | 218 +- .../suites/certification/Test_TC_CC_4_1.yaml | 62 +- .../suites/certification/Test_TC_CC_4_2.yaml | 342 +- .../suites/certification/Test_TC_CC_4_4.yaml | 41 +- .../suites/certification/Test_TC_CC_5_1.yaml | 40 +- .../suites/certification/Test_TC_CC_5_2.yaml | 52 +- .../suites/certification/Test_TC_CC_5_3.yaml | 40 +- .../suites/certification/Test_TC_CC_6_1.yaml | 20 +- .../suites/certification/Test_TC_CC_6_2.yaml | 192 +- .../suites/certification/Test_TC_CC_6_3.yaml | 102 +- .../suites/certification/Test_TC_CC_7_1.yaml | 214 +- .../suites/certification/Test_TC_CC_7_2.yaml | 132 +- .../suites/certification/Test_TC_CC_7_4.yaml | 24 +- .../zap-generated/test/Commands.h | 7698 ++++++++++++++--- .../chip-tool/zap-generated/test/Commands.h | 2984 ++++++- 16 files changed, 10511 insertions(+), 1860 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml index c81484dc66566d..27a4063cccd3ec 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_1.yaml @@ -39,7 +39,7 @@ tests: response: value: 1 - - label: "Reads CurrentHue attribute from DUT." + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: @@ -63,14 +63,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: 150 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move to hue longest distance command" command: "MoveToHue" @@ -87,14 +135,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: 150 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move to hue up command" command: "MoveToHue" @@ -111,14 +207,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: 250 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move to hue down command" command: "MoveToHue" @@ -135,14 +279,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: 225 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml index 5dc6541e81f5e9..01da79665aa17e 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_3_2.yaml @@ -39,14 +39,14 @@ tests: response: value: 1 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + - label: "Reads CurrentHue attribute from DUT" command: "readAttribute" attribute: "current hue" response: - value: 150 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move hue up command" command: "MoveHue" @@ -61,14 +61,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 140ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 140 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 145ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 145 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 150ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 150 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move hue stop command" command: "MoveHue" @@ -83,14 +131,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 140ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 140 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 145ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 145 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 150ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 150 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move hue down command" command: "MoveHue" @@ -105,14 +201,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 140ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 140 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 145ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 145 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 150ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 150 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move hue stop command" command: "MoveHue" @@ -127,14 +271,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 140ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 140 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 145ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 145 + + - label: + "Check current hue attribute value matched the value sent by the last + command" + command: "readAttribute" + attribute: "current hue" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 150ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 150 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml index b5f7aee70a6b32..0ea437d8cef2a2 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_1.yaml @@ -40,11 +40,13 @@ tests: value: 1 - label: "Check Saturation attribute value matched before any change" - disabled: true command: "readAttribute" attribute: "current saturation" response: - value: 90 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move to saturation command" command: "MoveToSaturation" @@ -59,14 +61,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 6ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 6 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 8ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 8 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 90 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml index 628940d6272e7a..c1beab49ce0384 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml @@ -42,11 +42,13 @@ tests: - label: "Check Saturation attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current saturation" response: - value: 90 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move saturation up command" command: "MoveSaturation" @@ -61,14 +63,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: -1 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move saturation down command" command: "MoveSaturation" @@ -83,12 +133,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read CurrentSaturation attribute from DUT several times" - disabled: true + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move saturation up command" command: "MoveSaturation" @@ -103,12 +203,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read CurrentSaturation attribute from DUT" - disabled: true + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move saturation stop command" command: "MoveSaturation" @@ -123,12 +273,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read CurrentSaturation attribute from DUT" - disabled: true + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move saturation down command" command: "MoveSaturation" @@ -143,12 +343,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read CurrentSaturation attribute from DUT several times" - disabled: true + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move saturation stop command" command: "MoveSaturation" @@ -163,12 +413,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read CurrentSaturation attribute from DUT" - disabled: true + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 0 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check current saturation attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "current saturation" + response: + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml index e85d190496f315..9cc487a6816803 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_4.yaml @@ -40,21 +40,23 @@ tests: response: value: 1 - - label: - "Check current hue attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current hue attribute value matched before any change" command: "readAttribute" attribute: "current hue" response: - value: 250 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Check Saturation attribute value matched before any change" - disabled: true command: "readAttribute" attribute: "current saturation" response: - value: 90 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Move To current hue and saturation command" command: "MoveToHueAndSaturation" @@ -70,23 +72,36 @@ tests: value: 0 - name: "optionsOverride" value: 0 + + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + - label: "Check current hue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current hue" response: - value: 40 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: - "Check Saturation attribute value matched the value sent by the last - command" - disabled: true + "Check current saturation attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "current saturation" response: - value: 160 + constraints: + type: uint8 + minValue: 0 + maxValue: 254 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml index df1d37f69c8950..689e09ec0c04d5 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_5_1.yaml @@ -39,23 +39,23 @@ tests: response: value: 1 - - label: - "Check current x attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current x attribute value matched before any change" command: "readAttribute" attribute: "current x" response: - value: 200 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: - "Check current y attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current y attribute value matched before any change" command: "readAttribute" attribute: "current y" response: - value: 300 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Move to Color command" command: "MoveToColor" @@ -72,23 +72,35 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 20ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 20 + - label: "Check current x attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current x" response: - value: 200 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Check current y attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current y" response: - value: 300 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_2.yaml index 860ea548facd3e..0c1e9971fce64b 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_5_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_5_2.yaml @@ -39,23 +39,23 @@ tests: response: value: 1 - - label: - "Check current x attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current x attribute value matched before any change" command: "readAttribute" attribute: "current x" response: - value: 200 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: - "Check current y attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current y attribute value matched before any change" command: "readAttribute" attribute: "current y" response: - value: 300 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Move Color command" command: "MoveColor" @@ -70,23 +70,35 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 150ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 150 + - label: "Check current x attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current x" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Check current y attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current y" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Stop Move Step command" command: "StopMoveStep" @@ -100,20 +112,24 @@ tests: - label: "Check current x attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current x" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Check current y attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current y" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml index c8b280b1643ac3..d3189979128f78 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_5_3.yaml @@ -39,23 +39,23 @@ tests: response: value: 1 - - label: - "Check current x attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current x attribute value matched before any change" command: "readAttribute" attribute: "current x" response: - value: 200 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - - label: - "Check current y attribute value matched the value sent by the last - command" - disabled: true + - label: "Check current y attribute value matched before any change" command: "readAttribute" attribute: "current y" response: - value: 300 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Step Color command" command: "StepColor" @@ -72,23 +72,35 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + - label: "Check current x attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current x" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Check current y attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "current y" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml index 9aea73ecf0a868..0ad883996e060a 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml @@ -42,11 +42,13 @@ tests: value: 1 - label: "Read current color temprature" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: 100 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Move To Color Temperature command" command: "MoveToColorTemperature" @@ -61,12 +63,22 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + - label: "Read current color temprature" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: 100 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml index 888d6fb086dc0a..a097d08653e565 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml @@ -66,12 +66,56 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 90ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 90 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 95ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 95 + - label: "Read current color temprature attribute from DUT several times" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Move down color temperature command" command: "MoveColorTemperature" @@ -90,12 +134,56 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 190ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 190 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 195ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 195 + - label: "Read current color temprature attribute from DUT several times" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 200ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 200 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Move up color temperature command" command: "MoveColorTemperature" @@ -131,12 +219,56 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 90ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 90 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 95ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 95 + - label: "Read current color temprature attribute from DUT several times" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 100ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 100 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Move down color temperature command" command: "MoveColorTemperature" @@ -172,12 +304,56 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 140ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 140 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 145ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 145 + - label: "Read current color temprature attribute from DUT several times" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 150ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 150 + + - label: "Read current color temprature attribute from DUT several times" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml index e4be1256d85d6d..4656ea9b8b4fee 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml @@ -41,11 +41,13 @@ tests: value: 1 - label: "Read current color temprature" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: 100 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Step up color temperature command" command: "StepColorTemperature" @@ -66,12 +68,56 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: "Read current color temprature" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: "Read current color temprature" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + - label: "Read current color temprature" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Step down color temperature command" command: "StepColorTemperature" @@ -92,12 +138,56 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: "Read current color temprature" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: "Read current color temprature" + command: "readAttribute" + attribute: "color temperature" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + - label: "Read current color temprature" - disabled: true command: "readAttribute" attribute: "color temperature" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65279 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml index 484110cbc1df8b..f78a3ffc194712 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_1.yaml @@ -57,11 +57,13 @@ tests: - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "enhanced current hue" response: - value: 1025 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move To Hue command" command: "EnhancedMoveToHue" @@ -78,14 +80,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "enhanced current hue" response: - value: 1100 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move To Hue command" command: "EnhancedMoveToHue" @@ -102,14 +152,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "enhanced current hue" response: - value: 1150 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move To Hue command" command: "EnhancedMoveToHue" @@ -126,14 +224,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "enhanced current hue" response: - value: 1200 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move To Hue command" command: "EnhancedMoveToHue" @@ -150,14 +296,62 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "enhanced current hue" response: - value: 1300 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_2.yaml index c41316a8ff6405..abd5ccbf55620f 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_2.yaml @@ -61,12 +61,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read EnhancedCurrentHue attribute from DUT several times" - disabled: true + - label: "Wait 290ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 290 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "enhanced current hue" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 295ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 295 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 300ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 300 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move Hue Stop command" command: "EnhancedMoveHue" @@ -81,12 +131,16 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read EnhancedCurrentHue attribute from DUT several times" - disabled: true + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "enhanced current hue" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move Hue Down command " command: "EnhancedMoveHue" @@ -101,12 +155,62 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read EnhancedCurrentHue attribute from DUT several times" - disabled: true + - label: "Wait 40ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 40 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 45ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 45 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" + command: "readAttribute" + attribute: "enhanced current hue" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 + + - label: "Wait 50ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 50 + + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "enhanced current hue" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced Move Hue Stop command" command: "EnhancedMoveHue" @@ -121,12 +225,16 @@ tests: - name: "optionsOverride" value: 0 - - label: "Read EnhancedCurrentHue attribute from DUT several times" - disabled: true + - label: + "Check EnhancedCurrentHue attribute value matched the value sent by + the last command" command: "readAttribute" attribute: "enhanced current hue" response: - value: -1 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml b/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml index a0808c95681987..d2d91a6c8423c4 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_7_4.yaml @@ -41,14 +41,14 @@ tests: response: value: 1 - - label: - "Check EnhancedCurrentHue attribute value matched the value sent by - the last command" - disabled: true + - label: "Reads EnhancedCurrentHue attribute from DUT" command: "readAttribute" attribute: "enhanced current hue" response: - value: 1025 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Enhanced move to hue and saturation command" command: "EnhancedMoveToHueAndSaturation" @@ -65,14 +65,24 @@ tests: - name: "optionsOverride" value: 0 + - label: "Wait 10ms" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 10 + - label: "Check EnhancedCurrentHue attribute value matched the value sent by the last command" - disabled: true command: "readAttribute" attribute: "enhanced current hue" response: - value: 1200 + constraints: + type: uint16 + minValue: 0 + maxValue: 65535 - label: "Turn off light that we turned on" cluster: "On/Off" diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index c08e7512eecebd..7a7189647d7d89 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -8161,7 +8161,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT.\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT\n"); err = TestReadsCurrentHueAttributeFromDut_3(); break; case 4: @@ -8169,24 +8169,132 @@ class Test_TC_CC_3_1 : public TestCommandBridge { err = TestMoveToHueShortestDistanceCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move to hue longest distance command\n"); - err = TestMoveToHueLongestDistanceCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 290ms\n"); + err = TestWait290ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move to hue up command\n"); - err = TestMoveToHueUpCommand_6(); + ChipLogProgress( + chipTool, " ***** Test Step 6 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Move to hue down command\n"); - err = TestMoveToHueDownCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 295ms\n"); + err = TestWait295ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 300ms\n"); + err = TestWait300ms_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Move to hue longest distance command\n"); + err = TestMoveToHueLongestDistanceCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 290ms\n"); + err = TestWait290ms_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 295ms\n"); + err = TestWait295ms_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 300ms\n"); + err = TestWait300ms_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Move to hue up command\n"); + err = TestMoveToHueUpCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 290ms\n"); + err = TestWait290ms_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 295ms\n"); + err = TestWait295ms_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Wait 300ms\n"); + err = TestWait300ms_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Move to hue down command\n"); + err = TestMoveToHueDownCommand_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait 290ms\n"); + err = TestWait290ms_26(); + break; + case 27: + ChipLogProgress( + chipTool, " ***** Test Step 27 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Wait 295ms\n"); + err = TestWait295ms_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait 300ms\n"); + err = TestWait300ms_30(); + break; + case 31: + ChipLogProgress( + chipTool, " ***** Test Step 31 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_33(); break; } @@ -8229,6 +8337,78 @@ class Test_TC_CC_3_1 : public TestCommandBridge { 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; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -8242,7 +8422,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 34; chip::Optional mNodeId; chip::Optional mCluster; @@ -8305,7 +8485,7 @@ class Test_TC_CC_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHue attribute from DUT. Error: %@", err); + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -8348,57 +8528,106 @@ class Test_TC_CC_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToHueLongestDistanceCommand_5() + CHIP_ERROR TestWait290ms_5() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:200]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue longest distance command Error: %@", err); + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToHueUpCommand_6() + CHIP_ERROR TestWait295ms_7() + { + SetIdentity("alpha"); + WaitForMs(295); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:250]; - params.direction = [NSNumber numberWithUnsignedChar:2]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue up command Error: %@", err); + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait300ms_9() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToHueDownCommand_7() + CHIP_ERROR TestMoveToHueLongestDistanceCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8406,14 +8635,14 @@ class Test_TC_CC_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:225]; - params.direction = [NSNumber numberWithUnsignedChar:3]; + params.hue = [NSNumber numberWithUnsignedChar:200]; + params.direction = [NSNumber numberWithUnsignedChar:1]; params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster moveToHueWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to hue down command Error: %@", err); + NSLog(@"Move to hue longest distance command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -8423,33 +8652,3372 @@ class Test_TC_CC_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() + CHIP_ERROR TestWait290ms_12() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_13() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() + CHIP_ERROR TestWait295ms_14() + { + SetIdentity("alpha"); + WaitForMs(295); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_15() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait300ms_16() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToHueUpCommand_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; + params.hue = [NSNumber numberWithUnsignedChar:250]; + params.direction = [NSNumber numberWithUnsignedChar:2]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move to hue up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait290ms_19() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_20() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait295ms_21() + { + SetIdentity("alpha"); + WaitForMs(295); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_22() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait300ms_23() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_24() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToHueDownCommand_25() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToHueParams alloc] init]; + params.hue = [NSNumber numberWithUnsignedChar:225]; + params.direction = [NSNumber numberWithUnsignedChar:3]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move to hue down command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait290ms_26() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_27() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait295ms_28() + { + SetIdentity("alpha"); + WaitForMs(295); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_29() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait300ms_30() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_31() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_32() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_33() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_3_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_3_2() + : TestCommandBridge("Test_TC_CC_3_2") + , 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_CC_3_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_2\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 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move hue up command\n"); + err = TestMoveHueUpCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 140ms\n"); + err = TestWait140ms_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 145ms\n"); + err = TestWait145ms_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 150ms\n"); + err = TestWait150ms_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Move hue stop command\n"); + err = TestMoveHueStopCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 140ms\n"); + err = TestWait140ms_12(); + break; + case 13: + ChipLogProgress( + chipTool, " ***** Test Step 13 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 145ms\n"); + err = TestWait145ms_14(); + break; + case 15: + ChipLogProgress( + chipTool, " ***** Test Step 15 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 150ms\n"); + err = TestWait150ms_16(); + break; + case 17: + ChipLogProgress( + chipTool, " ***** Test Step 17 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Move hue down command\n"); + err = TestMoveHueDownCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 140ms\n"); + err = TestWait140ms_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 145ms\n"); + err = TestWait145ms_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Wait 150ms\n"); + err = TestWait150ms_23(); + break; + case 24: + ChipLogProgress( + chipTool, " ***** Test Step 24 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Move hue stop command\n"); + err = TestMoveHueStopCommand_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait 140ms\n"); + err = TestWait140ms_26(); + break; + case 27: + ChipLogProgress( + chipTool, " ***** Test Step 27 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Wait 145ms\n"); + err = TestWait145ms_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait 150ms\n"); + err = TestWait150ms_30(); + break; + case 31: + ChipLogProgress( + chipTool, " ***** Test Step 31 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_33(); + 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; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 34; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveHueUpCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:50]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move hue up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait140ms_5() + { + SetIdentity("alpha"); + WaitForMs(140); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait145ms_7() + { + SetIdentity("alpha"); + WaitForMs(145); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait150ms_9() + { + SetIdentity("alpha"); + WaitForMs(150); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveHueStopCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedChar:50]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move hue stop command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait140ms_12() + { + SetIdentity("alpha"); + WaitForMs(140); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_13() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait145ms_14() + { + SetIdentity("alpha"); + WaitForMs(145); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_15() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait150ms_16() + { + SetIdentity("alpha"); + WaitForMs(150); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveHueDownCommand_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedChar:50]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move hue down command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait140ms_19() + { + SetIdentity("alpha"); + WaitForMs(140); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_20() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait145ms_21() + { + SetIdentity("alpha"); + WaitForMs(145); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_22() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait150ms_23() + { + SetIdentity("alpha"); + WaitForMs(150); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_24() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveHueStopCommand_25() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedChar:50]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move hue stop command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait140ms_26() + { + SetIdentity("alpha"); + WaitForMs(140); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_27() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait145ms_28() + { + SetIdentity("alpha"); + WaitForMs(145); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_29() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait150ms_30() + { + SetIdentity("alpha"); + WaitForMs(150); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_31() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_32() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_33() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_3_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_3_3() + : TestCommandBridge("Test_TC_CC_3_3") + , 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_CC_3_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_3\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 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT\n"); + err = TestReadsCurrentHueAttributeFromDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue up command\n"); + err = TestStepHueUpCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 25ms\n"); + err = TestWait25ms_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step hue down command\n"); + err = TestStepHueDownCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 25ms\n"); + err = TestWait25ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); + 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; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 12; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepHueUpCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:1]; + params.stepSize = [NSNumber numberWithUnsignedChar:5]; + params.transitionTime = [NSNumber numberWithUnsignedChar:25]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stepHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step hue up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait25ms_5() + { + SetIdentity("alpha"); + WaitForMs(25); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepHueDownCommand_7() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:3]; + params.stepSize = [NSNumber numberWithUnsignedChar:5]; + params.transitionTime = [NSNumber numberWithUnsignedChar:25]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster stepHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step hue down command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait25ms_8() + { + SetIdentity("alpha"); + WaitForMs(25); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_4_1() + : TestCommandBridge("Test_TC_CC_4_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_CC_4_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_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 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Check Saturation attribute value matched before any change\n"); + err = TestCheckSaturationAttributeValueMatchedBeforeAnyChange_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move to saturation command\n"); + err = TestMoveToSaturationCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 6ms\n"); + err = TestWait6ms_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 8ms\n"); + err = TestWait8ms_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 10ms\n"); + err = TestWait10ms_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_12(); + 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; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 13; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckSaturationAttributeValueMatchedBeforeAnyChange_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched before any change Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToSaturationCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; + params.saturation = [NSNumber numberWithUnsignedChar:90]; + params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveToSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move to saturation command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait6ms_5() + { + SetIdentity("alpha"); + WaitForMs(6); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait8ms_7() + { + SetIdentity("alpha"); + WaitForMs(8); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait10ms_9() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CC_4_2() + : TestCommandBridge("Test_TC_CC_4_2") + , 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_CC_4_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_2\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 : Turn on light for color control tests\n"); + err = TestTurnOnLightForColorControlTests_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Check Saturation attribute value matched the value sent by the last command\n"); + err = TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 40ms\n"); + err = TestWait40ms_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 45ms\n"); + err = TestWait45ms_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 50ms\n"); + err = TestWait50ms_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 40ms\n"); + err = TestWait40ms_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 45ms\n"); + err = TestWait45ms_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 50ms\n"); + err = TestWait50ms_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Move saturation up command\n"); + err = TestMoveSaturationUpCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Wait 40ms\n"); + err = TestWait40ms_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Wait 45ms\n"); + err = TestWait45ms_21(); + break; + case 22: + ChipLogProgress(chipTool, + " ***** Test Step 22 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Wait 50ms\n"); + err = TestWait50ms_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Move saturation stop command\n"); + err = TestMoveSaturationStopCommand_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Wait 40ms\n"); + err = TestWait40ms_26(); + break; + case 27: + ChipLogProgress(chipTool, + " ***** Test Step 27 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Wait 45ms\n"); + err = TestWait45ms_28(); + break; + case 29: + ChipLogProgress(chipTool, + " ***** Test Step 29 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait 50ms\n"); + err = TestWait50ms_30(); + break; + case 31: + ChipLogProgress(chipTool, + " ***** Test Step 31 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Move saturation down command\n"); + err = TestMoveSaturationDownCommand_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Wait 40ms\n"); + err = TestWait40ms_33(); + break; + case 34: + ChipLogProgress(chipTool, + " ***** Test Step 34 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Wait 45ms\n"); + err = TestWait45ms_35(); + break; + case 36: + ChipLogProgress(chipTool, + " ***** Test Step 36 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Wait 50ms\n"); + err = TestWait50ms_37(); + break; + case 38: + ChipLogProgress(chipTool, + " ***** Test Step 38 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : Move saturation stop command\n"); + err = TestMoveSaturationStopCommand_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : Wait 40ms\n"); + err = TestWait40ms_40(); + break; + case 41: + ChipLogProgress(chipTool, + " ***** Test Step 41 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : Wait 45ms\n"); + err = TestWait45ms_42(); + break; + case 43: + ChipLogProgress(chipTool, + " ***** Test Step 43 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : Wait 50ms\n"); + err = TestWait50ms_44(); + break; + case 45: + ChipLogProgress(chipTool, + " ***** Test Step 45 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_47(); + 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; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + WaitForMs(0); + } + + 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 = 48; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckSaturationAttributeValueMatchedTheValueSentByTheLastCommand_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationUpCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait40ms_5() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_7() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_9() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationDownCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation down command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait40ms_12() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_13() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_14() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_15() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_16() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationUpCommand_18() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait40ms_19() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_20() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_21() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_22() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_23() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_24() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationStopCommand_25() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation stop command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait40ms_26() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_27() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_28() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_29() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_30() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_31() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationDownCommand_32() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation down command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait40ms_33() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_34() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_35() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_36() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_37() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_38() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveSaturationStopCommand_39() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedChar:5]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move saturation stop command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait40ms_40() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_41() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_42() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_43() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_44() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_45() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_46() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_47() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -8465,11 +12033,11 @@ class Test_TC_CC_3_1 : public TestCommandBridge { } }; -class Test_TC_CC_3_2 : public TestCommandBridge { +class Test_TC_CC_4_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_3_2() - : TestCommandBridge("Test_TC_CC_3_2") + Test_TC_CC_4_3() + : TestCommandBridge("Test_TC_CC_4_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -8479,7 +12047,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_3_2() {} + ~Test_TC_CC_4_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -8487,11 +12055,11 @@ class Test_TC_CC_3_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -8516,28 +12084,40 @@ class Test_TC_CC_3_2 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move hue up command\n"); - err = TestMoveHueUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentSaturation attribute from DUT\n"); + err = TestReadsCurrentSaturationAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move hue stop command\n"); - err = TestMoveHueStopCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation up command\n"); + err = TestStepSaturationUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move hue down command\n"); - err = TestMoveHueDownCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move hue stop command\n"); - err = TestMoveHueStopCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentSaturation attribute from DUT\n"); + err = TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Step saturation down command\n"); + err = TestStepSaturationDownCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10ms\n"); + err = TestWait10ms_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Reads CurrentSaturation attribute from DUT\n"); + err = TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); break; } @@ -8577,6 +12157,15 @@ class Test_TC_CC_3_2 : public TestCommandBridge { 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; } // Go on to the next test. @@ -8590,7 +12179,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -8626,17 +12215,43 @@ class Test_TC_CC_3_2 : public TestCommandBridge { { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentSaturationAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads CurrentSaturation attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); } NextTest(); @@ -8645,103 +12260,123 @@ class Test_TC_CC_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveHueUpCommand_3() + CHIP_ERROR TestStepSaturationUpCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:50]; + __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:1]; + params.stepSize = [NSNumber numberWithUnsignedChar:15]; + params.transitionTime = [NSNumber numberWithUnsignedChar:10]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue up command Error: %@", err); + [cluster stepSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step saturation up command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveHueStopCommand_4() + CHIP_ERROR TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:50]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue stop command Error: %@", err); + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Read CurrentSaturation attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveHueDownCommand_5() + CHIP_ERROR TestStepSaturationDownCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedChar:50]; + __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:3]; + params.stepSize = [NSNumber numberWithUnsignedChar:20]; + params.transitionTime = [NSNumber numberWithUnsignedChar:10]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue down command Error: %@", err); + [cluster stepSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step saturation down command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait10ms_8() + { + SetIdentity("alpha"); + WaitForMs(10); return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveHueStopCommand_6() + CHIP_ERROR TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:50]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move hue stop command Error: %@", err); + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Over TransitionTime,Reads CurrentSaturation attribute from DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8759,7 +12394,7 @@ class Test_TC_CC_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8783,11 +12418,11 @@ class Test_TC_CC_3_2 : public TestCommandBridge { } }; -class Test_TC_CC_3_3 : public TestCommandBridge { +class Test_TC_CC_4_4 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_3_3() - : TestCommandBridge("Test_TC_CC_3_3") + Test_TC_CC_4_4() + : TestCommandBridge("Test_TC_CC_4_4") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -8797,7 +12432,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_3_3() {} + ~Test_TC_CC_4_4() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -8805,11 +12440,11 @@ class Test_TC_CC_3_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_3_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_4\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_3_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_4\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -8834,40 +12469,38 @@ class Test_TC_CC_3_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentHue attribute from DUT\n"); - err = TestReadsCurrentHueAttributeFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Check current hue attribute value matched before any change\n"); + err = TestCheckCurrentHueAttributeValueMatchedBeforeAnyChange_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step hue up command\n"); - err = TestStepHueUpCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check Saturation attribute value matched before any change\n"); + err = TestCheckSaturationAttributeValueMatchedBeforeAnyChange_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 25ms\n"); - err = TestWait25ms_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Move To current hue and saturation command\n"); + err = TestMoveToCurrentHueAndSaturationCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); - err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10ms\n"); + err = TestWait10ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step hue down command\n"); - err = TestStepHueDownCommand_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Check current hue attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 25ms\n"); - err = TestWait25ms_8(); + ChipLogProgress(chipTool, + " ***** Test Step 8 : Check current saturation attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Read CurrentHue attribute from DUT\n"); - err = TestOverTransitionTimeReadCurrentHueAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); break; } @@ -8913,9 +12546,6 @@ class Test_TC_CC_3_3 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -8929,7 +12559,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -8984,7 +12614,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentHueAttributeFromDut_3() + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedBeforeAnyChange_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -8992,7 +12622,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentHue attribute from DUT Error: %@", err); + NSLog(@"Check current hue attribute value matched before any change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -9010,39 +12640,65 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepHueUpCommand_4() + CHIP_ERROR TestCheckSaturationAttributeValueMatchedBeforeAnyChange_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedChar:5]; - params.transitionTime = [NSNumber numberWithUnsignedChar:25]; + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check Saturation attribute value matched before any change Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToHueAndSaturationParams alloc] init]; + params.hue = [NSNumber numberWithUnsignedChar:40]; + params.saturation = [NSNumber numberWithUnsignedChar:160]; + params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step hue up command Error: %@", err); + [cluster moveToHueAndSaturationWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move To current hue and saturation command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait25ms_5() + CHIP_ERROR TestWait10ms_6() { SetIdentity("alpha"); - WaitForMs(25); + WaitForMs(10); return CHIP_NO_ERROR; } - CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_6() + CHIP_ERROR TestCheckCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9050,7 +12706,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + NSLog(@"Check current hue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -9068,56 +12724,24 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepHueDownCommand_7() - { - SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterStepHueParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedChar:5]; - params.transitionTime = [NSNumber numberWithUnsignedChar:25]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step hue down command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait25ms_8() - { - SetIdentity("alpha"); - WaitForMs(25); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestOverTransitionTimeReadCurrentHueAttributeFromDut_9() + CHIP_ERROR TestCheckCurrentSaturationAttributeValueMatchedTheValueSentByTheLastCommand_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Over TransitionTime,Read CurrentHue attribute from DUT Error: %@", err); + [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current saturation attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentHue", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentHue", [value unsignedCharValue], 254)); + VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); } NextTest(); @@ -9126,7 +12750,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9144,7 +12768,7 @@ class Test_TC_CC_3_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9168,11 +12792,11 @@ class Test_TC_CC_3_3 : public TestCommandBridge { } }; -class Test_TC_CC_4_1 : public TestCommandBridge { +class Test_TC_CC_5_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_4_1() - : TestCommandBridge("Test_TC_CC_4_1") + Test_TC_CC_5_1() + : TestCommandBridge("Test_TC_CC_5_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -9182,7 +12806,7 @@ class Test_TC_CC_4_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_4_1() {} + ~Test_TC_CC_5_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9190,11 +12814,11 @@ class Test_TC_CC_4_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9219,16 +12843,38 @@ class Test_TC_CC_4_1 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to saturation command\n"); - err = TestMoveToSaturationCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Check current x attribute value matched before any change\n"); + err = TestCheckCurrentXAttributeValueMatchedBeforeAnyChange_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check current y attribute value matched before any change\n"); + err = TestCheckCurrentYAttributeValueMatchedBeforeAnyChange_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Move to Color command\n"); + err = TestMoveToColorCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 20ms\n"); + err = TestWait20ms_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Check current x attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current y attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); break; } @@ -9259,6 +12905,21 @@ class Test_TC_CC_4_1 : public TestCommandBridge { 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. @@ -9272,7 +12933,7 @@ class Test_TC_CC_4_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -9327,31 +12988,143 @@ class Test_TC_CC_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToSaturationCommand_3() + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedBeforeAnyChange_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveToSaturationParams alloc] init]; - params.saturation = [NSNumber numberWithUnsignedChar:90]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched before any change Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedBeforeAnyChange_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched before any change Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToColorCommand_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init]; + params.colorX = [NSNumber numberWithUnsignedShort:200U]; + params.colorY = [NSNumber numberWithUnsignedShort:300U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:20U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to saturation command Error: %@", err); + [cluster moveToColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move to Color command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait20ms_6() + { + SetIdentity("alpha"); + WaitForMs(20); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_7() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9369,7 +13142,7 @@ class Test_TC_CC_4_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9393,11 +13166,11 @@ class Test_TC_CC_4_1 : public TestCommandBridge { } }; -class Test_TC_CC_4_2 : public TestCommandBridge { +class Test_TC_CC_5_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_4_2() - : TestCommandBridge("Test_TC_CC_4_2") + Test_TC_CC_5_2() + : TestCommandBridge("Test_TC_CC_5_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -9407,7 +13180,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_4_2() {} + ~Test_TC_CC_5_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9415,11 +13188,11 @@ class Test_TC_CC_4_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9444,36 +13217,52 @@ class Test_TC_CC_4_2 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Check current x attribute value matched before any change\n"); + err = TestCheckCurrentXAttributeValueMatchedBeforeAnyChange_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check current y attribute value matched before any change\n"); + err = TestCheckCurrentYAttributeValueMatchedBeforeAnyChange_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move saturation up command\n"); - err = TestMoveSaturationUpCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Move Color command\n"); + err = TestMoveColorCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move saturation stop command\n"); - err = TestMoveSaturationStopCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 150ms\n"); + err = TestWait150ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Move saturation down command\n"); - err = TestMoveSaturationDownCommand_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Check current x attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Move saturation stop command\n"); - err = TestMoveSaturationStopCommand_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current y attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Stop Move Step command\n"); + err = TestStopMoveStepCommand_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); + ChipLogProgress( + chipTool, " ***** Test Step 10 : Check current x attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : Check current y attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13(); break; } @@ -9519,6 +13308,15 @@ class Test_TC_CC_4_2 : public TestCommandBridge { 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; } // Go on to the next test. @@ -9532,53 +13330,105 @@ class Test_TC_CC_4_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 11; + const uint16_t mTestCount = 14; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; chip::Optional mTimeout; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - SetIdentity("alpha"); - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity("alpha"); + WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOnLightForColorControlTests_1() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster onWithCompletionHandler:^(NSError * _Nullable err) { + NSLog(@"Turn on light for color control tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnLightForColorControlTests_1() + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedBeforeAnyChange_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched before any change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedBeforeAnyChange_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched before any change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -9587,151 +13437,164 @@ class Test_TC_CC_4_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveSaturationUpCommand_3() + CHIP_ERROR TestMoveColorCommand_5() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:5]; + __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; + params.rateX = [NSNumber numberWithShort:15]; + params.rateY = [NSNumber numberWithShort:20]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation up command Error: %@", err); + [cluster moveColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move Color command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait150ms_6() + { + SetIdentity("alpha"); + WaitForMs(150); return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveSaturationDownCommand_4() + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation down command Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveSaturationUpCommand_5() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation up command Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveSaturationStopCommand_6() + CHIP_ERROR TestStopMoveStepCommand_9() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:5]; + __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation stop command Error: %@", err); + [cluster stopMoveStepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Move Step command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveSaturationDownCommand_7() + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation down command Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveSaturationStopCommand_8() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveSaturationParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedChar:5]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move saturation stop command Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_12() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9749,7 +13612,7 @@ class Test_TC_CC_4_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -9773,11 +13636,11 @@ class Test_TC_CC_4_2 : public TestCommandBridge { } }; -class Test_TC_CC_4_3 : public TestCommandBridge { +class Test_TC_CC_5_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_4_3() - : TestCommandBridge("Test_TC_CC_4_3") + Test_TC_CC_5_3() + : TestCommandBridge("Test_TC_CC_5_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -9787,7 +13650,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_4_3() {} + ~Test_TC_CC_5_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -9795,11 +13658,11 @@ class Test_TC_CC_4_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -9824,40 +13687,38 @@ class Test_TC_CC_4_3 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Reads CurrentSaturation attribute from DUT\n"); - err = TestReadsCurrentSaturationAttributeFromDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Check current x attribute value matched before any change\n"); + err = TestCheckCurrentXAttributeValueMatchedBeforeAnyChange_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step saturation up command\n"); - err = TestStepSaturationUpCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Check current y attribute value matched before any change\n"); + err = TestCheckCurrentYAttributeValueMatchedBeforeAnyChange_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); - err = TestWait10ms_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Step Color command\n"); + err = TestStepColorCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Over TransitionTime,Read CurrentSaturation attribute from DUT\n"); - err = TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 50ms\n"); + err = TestWait50ms_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step saturation down command\n"); - err = TestStepSaturationDownCommand_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Check current x attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 10ms\n"); - err = TestWait10ms_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : Check current y attribute value matched the value sent by the last command\n"); + err = TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Over TransitionTime,Reads CurrentSaturation attribute from DUT\n"); - err = TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10(); break; } @@ -9903,9 +13764,6 @@ class Test_TC_CC_4_3 : public TestCommandBridge { case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -9919,7 +13777,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 11; chip::Optional mNodeId; chip::Optional mCluster; @@ -9974,82 +13832,50 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentSaturationAttributeFromDut_3() + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedBeforeAnyChange_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched before any change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); } NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStepSaturationUpCommand_4() - { - SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedChar:15]; - params.transitionTime = [NSNumber numberWithUnsignedChar:10]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step saturation up command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestWait10ms_5() - { - SetIdentity("alpha"); - WaitForMs(10); + }]; + return CHIP_NO_ERROR; } - CHIP_ERROR TestOverTransitionTimeReadCurrentSaturationAttributeFromDut_6() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedBeforeAnyChange_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Over TransitionTime,Read CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched before any change Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); } NextTest(); @@ -10058,56 +13884,56 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepSaturationDownCommand_7() + CHIP_ERROR TestStepColorCommand_5() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterStepSaturationParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedChar:20]; - params.transitionTime = [NSNumber numberWithUnsignedChar:10]; + __auto_type * params = [[CHIPColorControlClusterStepColorParams alloc] init]; + params.stepX = [NSNumber numberWithShort:15]; + params.stepY = [NSNumber numberWithShort:20]; + params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepSaturationWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step saturation down command Error: %@", err); + [cluster stepColorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Step Color command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWait10ms_8() + CHIP_ERROR TestWait50ms_6() { SetIdentity("alpha"); - WaitForMs(10); + WaitForMs(50); return CHIP_NO_ERROR; } - CHIP_ERROR TestOverTransitionTimeReadsCurrentSaturationAttributeFromDut_9() + CHIP_ERROR TestCheckCurrentXAttributeValueMatchedTheValueSentByTheLastCommand_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentSaturationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Over TransitionTime,Reads CurrentSaturation attribute from DUT Error: %@", err); + [cluster readAttributeCurrentXWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current x attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("currentSaturation", [value unsignedCharValue], 0)); + VerifyOrReturn(CheckConstraintMinValue("currentX", [value unsignedShortValue], 0U)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", [value unsignedCharValue], 254)); + VerifyOrReturn(CheckConstraintMaxValue("currentX", [value unsignedShortValue], 65279U)); } NextTest(); @@ -10116,7 +13942,33 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() + CHIP_ERROR TestCheckCurrentYAttributeValueMatchedTheValueSentByTheLastCommand_8() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentYWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check current y attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("currentY", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("currentY", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_9() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -10134,7 +13986,7 @@ class Test_TC_CC_4_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -10158,11 +14010,11 @@ class Test_TC_CC_4_3 : public TestCommandBridge { } }; -class Test_TC_CC_4_4 : public TestCommandBridge { +class Test_TC_CC_6_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_4_4() - : TestCommandBridge("Test_TC_CC_4_4") + Test_TC_CC_6_1() + : TestCommandBridge("Test_TC_CC_6_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -10172,7 +14024,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_4_4() {} + ~Test_TC_CC_6_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10180,11 +14032,11 @@ class Test_TC_CC_4_4 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_4_4\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_4_4\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10209,16 +14061,28 @@ class Test_TC_CC_4_4 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move To current hue and saturation command\n"); - err = TestMoveToCurrentHueAndSaturationCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Move To Color Temperature command\n"); + err = TestMoveToColorTemperatureCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); break; } @@ -10249,6 +14113,15 @@ class Test_TC_CC_4_4 : public TestCommandBridge { 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; } // Go on to the next test. @@ -10262,7 +14135,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -10317,22 +14190,47 @@ class Test_TC_CC_4_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToCurrentHueAndSaturationCommand_3() + CHIP_ERROR TestReadCurrentColorTemprature_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveToHueAndSaturationParams alloc] init]; - params.hue = [NSNumber numberWithUnsignedChar:40]; - params.saturation = [NSNumber numberWithUnsignedChar:160]; + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMoveToColorTemperatureCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init]; + params.colorTemperature = [NSNumber numberWithUnsignedShort:100U]; params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToHueAndSaturationWithParams:params + [cluster moveToColorTemperatureWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move To current hue and saturation command Error: %@", err); + NSLog(@"Move To Color Temperature command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -10342,7 +14240,40 @@ class Test_TC_CC_4_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTemprature_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -10360,7 +14291,7 @@ class Test_TC_CC_4_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -10384,11 +14315,11 @@ class Test_TC_CC_4_4 : public TestCommandBridge { } }; -class Test_TC_CC_5_1 : public TestCommandBridge { +class Test_TC_CC_6_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_5_1() - : TestCommandBridge("Test_TC_CC_5_1") + Test_TC_CC_6_2() + : TestCommandBridge("Test_TC_CC_6_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -10398,7 +14329,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_5_1() {} + ~Test_TC_CC_6_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -10406,11 +14337,11 @@ class Test_TC_CC_5_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -10430,21 +14361,141 @@ class Test_TC_CC_5_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 1 : Turn on light for color control tests\n"); err = TestTurnOnLightForColorControlTests_1(); break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 90ms\n"); + err = TestWait90ms_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 95ms\n"); + err = TestWait95ms_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 100ms\n"); + err = TestWait100ms_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Move down color temperature command\n"); + err = TestMoveDownColorTemperatureCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 190ms\n"); + err = TestWait190ms_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 195ms\n"); + err = TestWait195ms_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 200ms\n"); + err = TestWait200ms_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Move up color temperature command\n"); + err = TestMoveUpColorTemperatureCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Stop Color Temperature command\n"); + err = TestStopColorTemperatureCommand_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 90ms\n"); + err = TestWait90ms_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 95ms\n"); + err = TestWait95ms_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Wait 100ms\n"); + err = TestWait100ms_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Move down color temperature command\n"); + err = TestMoveDownColorTemperatureCommand_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Stop Color Temperature command\n"); + err = TestStopColorTemperatureCommand_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Wait 140ms\n"); + err = TestWait140ms_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Wait 145ms\n"); + err = TestWait145ms_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Wait 150ms\n"); + err = TestWait150ms_32(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move to Color command\n"); - err = TestMoveToColorCommand_3(); + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Read current color temprature attribute from DUT several times\n"); + err = TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_33(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_34(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_35(); break; } @@ -10475,6 +14526,96 @@ class Test_TC_CC_5_1 : public TestCommandBridge { 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; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -10488,7 +14629,7 @@ class Test_TC_CC_5_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 36; chip::Optional mNodeId; chip::Optional mCluster; @@ -10543,231 +14684,116 @@ class Test_TC_CC_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToColorCommand_3() + CHIP_ERROR TestReadCurrentColorTemprature_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveToColorParams alloc] init]; - params.colorX = [NSNumber numberWithUnsignedShort:200U]; - params.colorY = [NSNumber numberWithUnsignedShort:300U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:20U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move to Color command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() - { - SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestMoveUpColorTemperatureCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CC_5_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_5_2() - : TestCommandBridge("Test_TC_CC_5_2") - , 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_CC_5_2() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_2\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_2\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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move Color command\n"); - err = TestMoveColorCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Stop Move Step command\n"); - err = TestStopMoveStepCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); - 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; - } - - // Go on to the next test. - WaitForMs(0); - } + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:10U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move up color temperature command Error: %@", err); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + VerifyOrReturn(CheckValue("status", err, 0)); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + NextTest(); + }]; - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + return CHIP_NO_ERROR; + } - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWait90ms_5() { SetIdentity("alpha"); - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + WaitForMs(90); return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnLightForColorControlTests_1() + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_6() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestWait95ms_7() + { + SetIdentity("alpha"); + WaitForMs(95); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -10776,85 +14802,90 @@ class Test_TC_CC_5_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveColorCommand_3() + CHIP_ERROR TestWait100ms_9() + { + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveColorParams alloc] init]; - params.rateX = [NSNumber numberWithShort:15]; - params.rateY = [NSNumber numberWithShort:20]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move Color command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStopMoveStepCommand_4() + CHIP_ERROR TestMoveDownColorTemperatureCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterStopMoveStepParams alloc] init]; + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedShort:20U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stopMoveStepWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Stop Move Step command Error: %@", err); + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move down color temperature command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestWait190ms_12() { SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - + WaitForMs(190); return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_13() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -10862,225 +14893,183 @@ class Test_TC_CC_5_2 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_CC_5_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_5_3() - : TestCommandBridge("Test_TC_CC_5_3") - , mTestIndex(0) + CHIP_ERROR TestWait195ms_14() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + WaitForMs(195); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_CC_5_3() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_15() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_5_3\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_5_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // 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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step Color command\n"); - err = TestStepColorCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + VerifyOrReturn(CheckValue("status", err, 0)); - 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; - } + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } - // Go on to the next test. - WaitForMs(0); - } + NextTest(); + }]; - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + CHIP_ERROR TestWait200ms_16() { SetIdentity("alpha"); - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + WaitForMs(200); return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnLightForColorControlTests_1() + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_17() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestMoveUpColorTemperatureCommand_18() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:10U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move up color temperature command Error: %@", err); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); - } + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStepColorCommand_3() + CHIP_ERROR TestStopColorTemperatureCommand_19() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterStepColorParams alloc] init]; - params.stepX = [NSNumber numberWithShort:15]; - params.stepY = [NSNumber numberWithShort:20]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedShort:10U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step Color command Error: %@", err); + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Color Temperature command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait90ms_20() + { + SetIdentity("alpha"); + WaitForMs(90); return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_21() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestWait95ms_22() + { + SetIdentity("alpha"); + WaitForMs(95); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_23() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -11088,159 +15077,150 @@ class Test_TC_CC_5_3 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_CC_6_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_6_1() - : TestCommandBridge("Test_TC_CC_6_1") - , mTestIndex(0) + CHIP_ERROR TestWait100ms_24() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + SetIdentity("alpha"); + WaitForMs(100); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_CC_6_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_25() { - CHIP_ERROR err = CHIP_NO_ERROR; + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_1\n"); - } + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } - // 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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Move To Color Temperature command\n"); - err = TestMoveToColorTemperatureCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestMoveDownColorTemperatureCommand_26() { - 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; - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Go on to the next test. - WaitForMs(0); + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:3]; + params.rate = [NSNumber numberWithUnsignedShort:20U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Move down color temperature command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestStopColorTemperatureCommand_27() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedShort:10U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster moveColorTemperatureWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Stop Color Temperature command Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait140ms_28() { SetIdentity("alpha"); - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + WaitForMs(140); return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnLightForColorControlTests_1() + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_29() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestWait145ms_30() + { + SetIdentity("alpha"); + WaitForMs(145); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_31() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); } NextTest(); @@ -11249,31 +15229,40 @@ class Test_TC_CC_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveToColorTemperatureCommand_3() + CHIP_ERROR TestWait150ms_32() + { + SetIdentity("alpha"); + WaitForMs(150); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTempratureAttributeFromDutSeveralTimes_33() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveToColorTemperatureParams alloc] init]; - params.colorTemperature = [NSNumber numberWithUnsignedShort:100U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:10U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveToColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move To Color Temperature command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature attribute from DUT several times Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_34() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -11291,7 +15280,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_35() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -11315,11 +15304,11 @@ class Test_TC_CC_6_1 : public TestCommandBridge { } }; -class Test_TC_CC_6_2 : public TestCommandBridge { +class Test_TC_CC_6_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_6_2() - : TestCommandBridge("Test_TC_CC_6_2") + Test_TC_CC_6_3() + : TestCommandBridge("Test_TC_CC_6_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -11329,7 +15318,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_6_2() {} + ~Test_TC_CC_6_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11337,11 +15326,11 @@ class Test_TC_CC_6_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11370,36 +15359,68 @@ class Test_TC_CC_6_2 : public TestCommandBridge { err = TestReadCurrentColorTemprature_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Move up color temperature command\n"); - err = TestMoveUpColorTemperatureCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Step up color temperature command\n"); + err = TestStepUpColorTemperatureCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Move down color temperature command\n"); - err = TestMoveDownColorTemperatureCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 40ms\n"); + err = TestWait40ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Move up color temperature command\n"); - err = TestMoveUpColorTemperatureCommand_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Stop Color Temperature command\n"); - err = TestStopColorTemperatureCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 45ms\n"); + err = TestWait45ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Move down color temperature command\n"); - err = TestMoveDownColorTemperatureCommand_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Stop Color Temperature command\n"); - err = TestStopColorTemperatureCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 50ms\n"); + err = TestWait50ms_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Step down color temperature command\n"); + err = TestStepDownColorTemperatureCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Wait 40ms\n"); + err = TestWait40ms_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 45ms\n"); + err = TestWait45ms_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 50ms\n"); + err = TestWait50ms_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Read current color temprature\n"); + err = TestReadCurrentColorTemprature_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19(); break; } @@ -11448,6 +15469,30 @@ class Test_TC_CC_6_2 : public TestCommandBridge { 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; } // Go on to the next test. @@ -11461,7 +15506,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; @@ -11542,23 +15587,24 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveUpColorTemperatureCommand_4() + CHIP_ERROR TestStepUpColorTemperatureCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:1]; + params.stepSize = [NSNumber numberWithUnsignedShort:5U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params + [cluster stepColorTemperatureWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move up color temperature command Error: %@", err); + NSLog(@"Step up color temperature command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -11568,23 +15614,123 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveDownColorTemperatureCommand_5() + CHIP_ERROR TestWait40ms_5() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTemprature_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_7() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTemprature_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedShort:20U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_9() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTemprature_10() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStepDownColorTemperatureCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:3]; + params.stepSize = [NSNumber numberWithUnsignedShort:5U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; + params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; + params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params + [cluster stepColorTemperatureWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move down color temperature command Error: %@", err); + NSLog(@"Step down color temperature command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -11594,111 +15740,106 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveUpColorTemperatureCommand_6() + CHIP_ERROR TestWait40ms_12() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentColorTemprature_13() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move up color temperature command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait45ms_14() + { + SetIdentity("alpha"); + WaitForMs(45); return CHIP_NO_ERROR; } - CHIP_ERROR TestStopColorTemperatureCommand_7() + CHIP_ERROR TestReadCurrentColorTemprature_15() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Stop Color Temperature command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMoveDownColorTemperatureCommand_8() + CHIP_ERROR TestWait50ms_16() { SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:3]; - params.rate = [NSNumber numberWithUnsignedShort:20U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Move down color temperature command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - + WaitForMs(50); return CHIP_NO_ERROR; } - CHIP_ERROR TestStopColorTemperatureCommand_9() + CHIP_ERROR TestReadCurrentColorTemprature_17() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterMoveColorTemperatureParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:10U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:1U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:255U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster moveColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Stop Color Temperature command Error: %@", err); + [cluster readAttributeColorTemperatureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current color temprature Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("colorTemperature", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", [value unsignedShortValue], 65279U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_10() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_18() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -11716,7 +15857,7 @@ class Test_TC_CC_6_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_11() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -11740,11 +15881,11 @@ class Test_TC_CC_6_2 : public TestCommandBridge { } }; -class Test_TC_CC_6_3 : public TestCommandBridge { +class Test_TC_CC_7_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_6_3() - : TestCommandBridge("Test_TC_CC_6_3") + Test_TC_CC_7_1() + : TestCommandBridge("Test_TC_CC_7_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -11754,7 +15895,7 @@ class Test_TC_CC_6_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CC_6_3() {} + ~Test_TC_CC_7_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11762,11 +15903,11 @@ class Test_TC_CC_6_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_6_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_6_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11790,52 +15931,261 @@ class Test_TC_CC_6_3 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step up color temperature command\n"); - err = TestStepUpColorTemperatureCommand_3(); + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 290ms\n"); + err = TestWait290ms_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Wait 295ms\n"); + err = TestWait295ms_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 300ms\n"); + err = TestWait300ms_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 290ms\n"); + err = TestWait290ms_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Wait 295ms\n"); + err = TestWait295ms_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Wait 300ms\n"); + err = TestWait300ms_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait 290ms\n"); + err = TestWait290ms_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Wait 295ms\n"); + err = TestWait295ms_22(); + break; + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Wait 300ms\n"); + err = TestWait300ms_24(); + break; + case 25: + ChipLogProgress(chipTool, + " ***** Test Step 25 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Enhanced Move To Hue command\n"); + err = TestEnhancedMoveToHueCommand_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Wait 290ms\n"); + err = TestWait290ms_27(); + break; + case 28: + ChipLogProgress(chipTool, + " ***** Test Step 28 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Wait 295ms\n"); + err = TestWait295ms_29(); + break; + case 30: + ChipLogProgress(chipTool, + " ***** Test Step 30 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Wait 300ms\n"); + err = TestWait300ms_31(); + break; + case 32: + ChipLogProgress(chipTool, + " ***** Test Step 32 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_34(); + 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 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step down color temperature command\n"); - err = TestStepDownColorTemperatureCommand_4(); + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_5(); + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6(); + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); 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: + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 1: + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 2: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 3: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 4: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 5: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 6: + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; } @@ -11851,7 +16201,7 @@ class Test_TC_CC_6_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 35; chip::Optional mNodeId; chip::Optional mCluster; @@ -11906,93 +16256,297 @@ class Test_TC_CC_6_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStepUpColorTemperatureCommand_3() + CHIP_ERROR TestEnhancedMoveToHueCommand_3() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:1]; - params.stepSize = [NSNumber numberWithUnsignedShort:5U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:1025U]; + params.direction = [NSNumber numberWithUnsignedChar:0]; + params.transitionTime = [NSNumber numberWithUnsignedShort:1U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step up color temperature command Error: %@", err); + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move To Hue command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStepDownColorTemperatureCommand_4() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterStepColorTemperatureParams alloc] init]; - params.stepMode = [NSNumber numberWithUnsignedChar:3]; - params.stepSize = [NSNumber numberWithUnsignedShort:5U]; - params.transitionTime = [NSNumber numberWithUnsignedShort:50U]; - params.colorTemperatureMinimum = [NSNumber numberWithUnsignedShort:5U]; - params.colorTemperatureMaximum = [NSNumber numberWithUnsignedShort:100U]; + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedMoveToHueCommand_5() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:1100U]; + params.direction = [NSNumber numberWithUnsignedChar:0]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster stepColorTemperatureWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Step down color temperature command Error: %@", err); + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move To Hue command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait290ms_6() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_7() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait295ms_8() + { + SetIdentity("alpha"); + WaitForMs(295); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_9() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait300ms_10() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_11() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedMoveToHueCommand_12() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:1150U]; + params.direction = [NSNumber numberWithUnsignedChar:1]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move To Hue command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait290ms_13() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_14() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait295ms_15() + { + SetIdentity("alpha"); + WaitForMs(295); return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_5() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_16() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn off light that we turned on Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_6() + CHIP_ERROR TestWait300ms_17() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_18() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); } NextTest(); @@ -12000,187 +16554,123 @@ class Test_TC_CC_6_3 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; - -class Test_TC_CC_7_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CC_7_1() - : TestCommandBridge("Test_TC_CC_7_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_CC_7_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestEnhancedMoveToHueCommand_19() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CC_7_1\n"); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CC_7_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:1200U]; + params.direction = [NSNumber numberWithUnsignedChar:2]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster enhancedMoveToHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move To Hue command Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err, 0)); - // 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 : Turn on light for color control tests\n"); - err = TestTurnOnLightForColorControlTests_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Move To Hue command\n"); - err = TestEnhancedMoveToHueCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9(); - break; - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestWait290ms_20() { - 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; - } - - // Go on to the next test. - WaitForMs(0); + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_21() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait295ms_22() { SetIdentity("alpha"); - WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + WaitForMs(295); return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOnLightForColorControlTests_1() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_23() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletionHandler:^(NSError * _Nullable err) { - NSLog(@"Turn on light for color control tests Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestWait300ms_24() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_25() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); } NextTest(); @@ -12189,7 +16679,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveToHueCommand_3() + CHIP_ERROR TestEnhancedMoveToHueCommand_26() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12197,9 +16687,9 @@ class Test_TC_CC_7_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1025U]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:1U]; + params.enhancedHue = [NSNumber numberWithUnsignedShort:1300U]; + params.direction = [NSNumber numberWithUnsignedChar:3]; + params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveToHueWithParams:params @@ -12214,107 +16704,106 @@ class Test_TC_CC_7_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveToHueCommand_4() + CHIP_ERROR TestWait290ms_27() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_28() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1100U]; - params.direction = [NSNumber numberWithUnsignedChar:0]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } - VerifyOrReturn(CheckValue("status", err, 0)); + NextTest(); + }]; - NextTest(); - }]; + return CHIP_NO_ERROR; + } + CHIP_ERROR TestWait295ms_29() + { + SetIdentity("alpha"); + WaitForMs(295); return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveToHueCommand_5() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_30() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1150U]; - params.direction = [NSNumber numberWithUnsignedChar:1]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveToHueCommand_6() + CHIP_ERROR TestWait300ms_31() { SetIdentity("alpha"); - CHIPDevice * device = GetConnectedDevice(); - CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1200U]; - params.direction = [NSNumber numberWithUnsignedChar:2]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err, 0)); - - NextTest(); - }]; - + WaitForMs(300); return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveToHueCommand_7() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_32() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveToHueParams alloc] init]; - params.enhancedHue = [NSNumber numberWithUnsignedShort:1300U]; - params.direction = [NSNumber numberWithUnsignedChar:3]; - params.transitionTime = [NSNumber numberWithUnsignedShort:300U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveToHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move To Hue command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_33() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12332,7 +16821,7 @@ class Test_TC_CC_7_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_34() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12415,24 +16904,88 @@ class Test_TC_CC_7_2 : public TestCommandBridge { err = TestEnhancedMoveHueUpCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 290ms\n"); + err = TestWait290ms_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Enhanced Move Hue Down command \n"); - err = TestEnhancedMoveHueDownCommand_6(); + ChipLogProgress(chipTool, + " ***** Test Step 6 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Enhanced Move Hue Stop command\n"); - err = TestEnhancedMoveHueStopCommand_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Wait 295ms\n"); + err = TestWait295ms_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_8(); + ChipLogProgress(chipTool, + " ***** Test Step 8 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Wait 300ms\n"); + err = TestWait300ms_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Enhanced Move Hue Down command \n"); + err = TestEnhancedMoveHueDownCommand_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Wait 40ms\n"); + err = TestWait40ms_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 45ms\n"); + err = TestWait45ms_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait 50ms\n"); + err = TestWait50ms_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Enhanced Move Hue Stop command\n"); + err = TestEnhancedMoveHueStopCommand_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_23(); break; } @@ -12475,6 +17028,48 @@ class Test_TC_CC_7_2 : public TestCommandBridge { 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; } // Go on to the next test. @@ -12488,7 +17083,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + const uint16_t mTestCount = 24; chip::Optional mNodeId; chip::Optional mCluster; @@ -12520,21 +17115,137 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedMoveHueUpCommand_4() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; + params.moveMode = [NSNumber numberWithUnsignedChar:1]; + params.rate = [NSNumber numberWithUnsignedShort:50U]; + params.optionsMask = [NSNumber numberWithUnsignedChar:0]; + params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; + [cluster enhancedMoveHueWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Enhanced Move Hue Up command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait290ms_5() + { + SetIdentity("alpha"); + WaitForMs(290); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait295ms_7() + { + SetIdentity("alpha"); + WaitForMs(295); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); - CHIPTestOnOff * cluster = [[CHIPTestOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnOffWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check on/off attribute value is true after on command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("OnOff", actualValue, 1)); + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); } NextTest(); @@ -12543,7 +17254,14 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckEnhancedCurrentHueAttributeFromDut_3() + CHIP_ERROR TestWait300ms_9() + { + SetIdentity("alpha"); + WaitForMs(300); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_10() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12551,7 +17269,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Check EnhancedCurrentHue attribute from DUT Error: %@", err); + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -12569,7 +17287,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveHueUpCommand_4() + CHIP_ERROR TestEnhancedMoveHueStopCommand_11() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12577,13 +17295,13 @@ class Test_TC_CC_7_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:1]; - params.rate = [NSNumber numberWithUnsignedShort:50U]; + params.moveMode = [NSNumber numberWithUnsignedChar:0]; + params.rate = [NSNumber numberWithUnsignedShort:0U]; params.optionsMask = [NSNumber numberWithUnsignedChar:0]; params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster enhancedMoveHueWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Up command Error: %@", err); + NSLog(@"Enhanced Move Hue Stop command Error: %@", err); VerifyOrReturn(CheckValue("status", err, 0)); @@ -12593,31 +17311,33 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveHueStopCommand_5() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_12() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPColorControlClusterEnhancedMoveHueParams alloc] init]; - params.moveMode = [NSNumber numberWithUnsignedChar:0]; - params.rate = [NSNumber numberWithUnsignedShort:0U]; - params.optionsMask = [NSNumber numberWithUnsignedChar:0]; - params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; - [cluster enhancedMoveHueWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Enhanced Move Hue Stop command Error: %@", err); + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); - VerifyOrReturn(CheckValue("status", err, 0)); + VerifyOrReturn(CheckValue("status", err, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveHueDownCommand_6() + CHIP_ERROR TestEnhancedMoveHueDownCommand_13() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12641,7 +17361,106 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveHueStopCommand_7() + CHIP_ERROR TestWait40ms_14() + { + SetIdentity("alpha"); + WaitForMs(40); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_15() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait45ms_16() + { + SetIdentity("alpha"); + WaitForMs(45); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_17() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait50ms_18() + { + SetIdentity("alpha"); + WaitForMs(50); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_19() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedMoveHueStopCommand_20() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12665,7 +17484,33 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_8() + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_21() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_22() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -12683,7 +17528,7 @@ class Test_TC_CC_7_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_9() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_23() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -13143,16 +17988,29 @@ class Test_TC_CC_7_4 : public TestCommandBridge { err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Enhanced move to hue and saturation command\n"); - err = TestEnhancedMoveToHueAndSaturationCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads EnhancedCurrentHue attribute from DUT\n"); + err = TestReadsEnhancedCurrentHueAttributeFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Turn off light that we turned on\n"); - err = TestTurnOffLightThatWeTurnedOn_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Enhanced move to hue and saturation command\n"); + err = TestEnhancedMoveToHueAndSaturationCommand_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 10ms\n"); + err = TestWait10ms_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Check EnhancedCurrentHue attribute value matched the value sent by the last command\n"); + err = TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Turn off light that we turned on\n"); + err = TestTurnOffLightThatWeTurnedOn_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8(); break; } @@ -13183,6 +18041,15 @@ class Test_TC_CC_7_4 : public TestCommandBridge { 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; } // Go on to the next test. @@ -13196,7 +18063,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 9; chip::Optional mNodeId; chip::Optional mCluster; @@ -13251,7 +18118,33 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_3() + CHIP_ERROR TestReadsEnhancedCurrentHueAttributeFromDut_3() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads EnhancedCurrentHue attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestEnhancedMoveToHueAndSaturationCommand_4() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -13276,7 +18169,40 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTurnOffLightThatWeTurnedOn_4() + CHIP_ERROR TestWait10ms_5() + { + SetIdentity("alpha"); + WaitForMs(10); + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCheckEnhancedCurrentHueAttributeValueMatchedTheValueSentByTheLastCommand_6() + { + SetIdentity("alpha"); + CHIPDevice * device = GetConnectedDevice(); + CHIPTestColorControl * cluster = [[CHIPTestColorControl alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEnhancedCurrentHueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check EnhancedCurrentHue attribute value matched the value sent by the last command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err, 0)); + + VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_7() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); @@ -13294,7 +18220,7 @@ class Test_TC_CC_7_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_8() { SetIdentity("alpha"); CHIPDevice * device = GetConnectedDevice(); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 128baf07afa272..62ab083d6ffe1e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -4472,7 +4472,7 @@ class Test_TC_CC_2_1Suite : public TestCommand class Test_TC_CC_3_1Suite : public TestCommand { public: - Test_TC_CC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_1", 10, credsIssuerConfig) + Test_TC_CC_3_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_1", 34, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -4535,17 +4535,185 @@ class Test_TC_CC_3_1Suite : public TestCommand break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -4583,7 +4751,7 @@ class Test_TC_CC_3_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Reads CurrentHue attribute from DUT."); + LogStep(3, "Reads CurrentHue attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 4: { @@ -4597,7 +4765,34 @@ class Test_TC_CC_3_1Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value); } case 5: { - LogStep(5, "Move to hue longest distance command"); + LogStep(5, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 6: { + LogStep(6, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 7: { + LogStep(7, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 8: { + LogStep(8, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 9: { + LogStep(9, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 10: { + LogStep(10, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 11: { + LogStep(11, "Move to hue longest distance command"); chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; value.hue = 200; value.direction = static_cast(1); @@ -4606,8 +4801,35 @@ class Test_TC_CC_3_1Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value); } - case 6: { - LogStep(6, "Move to hue up command"); + case 12: { + LogStep(12, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 13: { + LogStep(13, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 14: { + LogStep(14, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 15: { + LogStep(15, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 16: { + LogStep(16, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 17: { + LogStep(17, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 18: { + LogStep(18, "Move to hue up command"); chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; value.hue = 250; value.direction = static_cast(2); @@ -4616,8 +4838,35 @@ class Test_TC_CC_3_1Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value); } - case 7: { - LogStep(7, "Move to hue down command"); + case 19: { + LogStep(19, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 20: { + LogStep(20, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 21: { + LogStep(21, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 22: { + LogStep(22, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 23: { + LogStep(23, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 24: { + LogStep(24, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 25: { + LogStep(25, "Move to hue down command"); chip::app::Clusters::ColorControl::Commands::MoveToHue::Type value; value.hue = 225; value.direction = static_cast(3); @@ -4626,13 +4875,40 @@ class Test_TC_CC_3_1Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHue::Id, value); } - case 8: { - LogStep(8, "Turn off light that we turned on"); + case 26: { + LogStep(26, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 27: { + LogStep(27, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 28: { + LogStep(28, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 29: { + LogStep(29, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 30: { + LogStep(30, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 31: { + LogStep(31, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 32: { + LogStep(32, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 9: { - LogStep(9, "Check on/off attribute value is false after off command"); + case 33: { + LogStep(33, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -4643,7 +4919,7 @@ class Test_TC_CC_3_1Suite : public TestCommand class Test_TC_CC_3_2Suite : public TestCommand { public: - Test_TC_CC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_2", 9, credsIssuerConfig) + Test_TC_CC_3_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_2", 34, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -4693,158 +4969,81 @@ class Test_TC_CC_3_2Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - bool value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("onOff", value, 0)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } 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"); - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); - } - case 1: { - LogStep(1, "Turn on light for color control tests"); - chip::app::Clusters::OnOff::Commands::On::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value); - } - case 2: { - LogStep(2, "Check on/off attribute value is true after on command"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); - } - case 3: { - LogStep(3, "Move hue up command"); - chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; - value.moveMode = static_cast(1); - value.rate = 50; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); - } - case 4: { - LogStep(4, "Move hue stop command"); - chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; - value.moveMode = static_cast(0); - value.rate = 50; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); - } - case 5: { - LogStep(5, "Move hue down command"); - chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; - value.moveMode = static_cast(3); - value.rate = 50; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); - } - case 6: { - LogStep(6, "Move hue stop command"); - chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; - value.moveMode = static_cast(0); - value.rate = 50; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); - } - case 7: { - LogStep(7, "Turn off light that we turned on"); - chip::app::Clusters::OnOff::Commands::Off::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); - } - case 8: { - LogStep(8, "Check on/off attribute value is false after off command"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CC_3_3Suite : public TestCommand -{ -public: - Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 12, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_CC_3_3Suite() {} - - 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: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 1: + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 2: + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - bool value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("onOff", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; - case 3: + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -4854,14 +5053,28 @@ class Test_TC_CC_3_3Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; - case 4: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 5: + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 6: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -4871,14 +5084,25 @@ class Test_TC_CC_3_3Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; - case 7: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 8: + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 9: + case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -4888,10 +5112,55 @@ class Test_TC_CC_3_3Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); } break; - case 10: + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: + 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; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -4933,50 +5202,156 @@ class Test_TC_CC_3_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 4: { - LogStep(4, "Step hue up command"); - chip::app::Clusters::ColorControl::Commands::StepHue::Type value; - value.stepMode = static_cast(1); - value.stepSize = 5; - value.transitionTime = 25; + LogStep(4, "Move hue up command"); + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(1); + value.rate = 50; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); } case 5: { - LogStep(5, "Wait 25ms"); + LogStep(5, "Wait 140ms"); SetIdentity(kIdentityAlpha); - return WaitForMs(25); + return WaitForMs(140); } case 6: { - LogStep(6, "Over TransitionTime,Read CurrentHue attribute from DUT"); + LogStep(6, "Check current hue attribute value matched the value sent by the last command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } case 7: { - LogStep(7, "Step hue down command"); - chip::app::Clusters::ColorControl::Commands::StepHue::Type value; - value.stepMode = static_cast(3); - value.stepSize = 5; - value.transitionTime = 25; + LogStep(7, "Wait 145ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(145); + } + case 8: { + LogStep(8, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 9: { + LogStep(9, "Wait 150ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(150); + } + case 10: { + LogStep(10, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 11: { + LogStep(11, "Move hue stop command"); + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(0); + value.rate = 50; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); } - case 8: { - LogStep(8, "Wait 25ms"); + case 12: { + LogStep(12, "Wait 140ms"); SetIdentity(kIdentityAlpha); - return WaitForMs(25); + return WaitForMs(140); } - case 9: { - LogStep(9, "Over TransitionTime,Read CurrentHue attribute from DUT"); + case 13: { + LogStep(13, "Check current hue attribute value matched the value sent by the last command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); } - case 10: { - LogStep(10, "Turn off light that we turned on"); + case 14: { + LogStep(14, "Wait 145ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(145); + } + case 15: { + LogStep(15, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 16: { + LogStep(16, "Wait 150ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(150); + } + case 17: { + LogStep(17, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 18: { + LogStep(18, "Move hue down command"); + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(3); + value.rate = 50; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); + } + case 19: { + LogStep(19, "Wait 140ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(140); + } + case 20: { + LogStep(20, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 21: { + LogStep(21, "Wait 145ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(145); + } + case 22: { + LogStep(22, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 23: { + LogStep(23, "Wait 150ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(150); + } + case 24: { + LogStep(24, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 25: { + LogStep(25, "Move hue stop command"); + chip::app::Clusters::ColorControl::Commands::MoveHue::Type value; + value.moveMode = static_cast(0); + value.rate = 50; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveHue::Id, value); + } + case 26: { + LogStep(26, "Wait 140ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(140); + } + case 27: { + LogStep(27, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 28: { + LogStep(28, "Wait 145ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(145); + } + case 29: { + LogStep(29, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 30: { + LogStep(30, "Wait 150ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(150); + } + case 31: { + LogStep(31, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 32: { + LogStep(32, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 11: { - LogStep(11, "Check on/off attribute value is false after off command"); + case 33: { + LogStep(33, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -4984,10 +5359,10 @@ class Test_TC_CC_3_3Suite : public TestCommand } }; -class Test_TC_CC_4_1Suite : public TestCommand +class Test_TC_CC_3_3Suite : public TestCommand { public: - Test_TC_CC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_1", 6, credsIssuerConfig) + Test_TC_CC_3_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_3_3", 12, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -4995,7 +5370,7 @@ class Test_TC_CC_4_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_4_1Suite() {} + ~Test_TC_CC_3_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -5037,11 +5412,52 @@ class Test_TC_CC_4_1Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5079,22 +5495,54 @@ class Test_TC_CC_4_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Move to saturation command"); - chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; - value.saturation = 90; - value.transitionTime = 10U; + LogStep(3, "Reads CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 4: { + LogStep(4, "Step hue up command"); + chip::app::Clusters::ColorControl::Commands::StepHue::Type value; + value.stepMode = static_cast(1); + value.stepSize = 5; + value.transitionTime = 25; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, - value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); } - case 4: { - LogStep(4, "Turn off light that we turned on"); + case 5: { + LogStep(5, "Wait 25ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(25); + } + case 6: { + LogStep(6, "Over TransitionTime,Read CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 7: { + LogStep(7, "Step hue down command"); + chip::app::Clusters::ColorControl::Commands::StepHue::Type value; + value.stepMode = static_cast(3); + value.stepSize = 5; + value.transitionTime = 25; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepHue::Id, value); + } + case 8: { + LogStep(8, "Wait 25ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(25); + } + case 9: { + LogStep(9, "Over TransitionTime,Read CurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 10: { + LogStep(10, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 5: { - LogStep(5, "Check on/off attribute value is false after off command"); + case 11: { + LogStep(11, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5102,10 +5550,10 @@ class Test_TC_CC_4_1Suite : public TestCommand } }; -class Test_TC_CC_4_2Suite : public TestCommand +class Test_TC_CC_4_1Suite : public TestCommand { public: - Test_TC_CC_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_2", 11, credsIssuerConfig) + Test_TC_CC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_1", 13, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5113,7 +5561,7 @@ class Test_TC_CC_4_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CC_4_2Suite() {} + ~Test_TC_CC_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -5155,26 +5603,63 @@ class Test_TC_CC_4_2Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5212,34 +5697,617 @@ class Test_TC_CC_4_2Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Move saturation up command"); - chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; - value.moveMode = static_cast(1); - value.rate = 5; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + LogStep(3, "Check Saturation attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); } case 4: { - LogStep(4, "Move saturation down command"); - chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; - value.moveMode = static_cast(3); - value.rate = 5; + LogStep(4, "Move to saturation command"); + chip::app::Clusters::ColorControl::Commands::MoveToSaturation::Type value; + value.saturation = 90; + value.transitionTime = 10U; value.optionsMask = 0; value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToSaturation::Id, + value); } case 5: { - LogStep(5, "Move saturation up command"); - chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; - value.moveMode = static_cast(1); - value.rate = 5; + LogStep(5, "Wait 6ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(6); + } + case 6: { + LogStep(6, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 7: { + LogStep(7, "Wait 8ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(8); + } + case 8: { + LogStep(8, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 9: { + LogStep(9, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 10: { + LogStep(10, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 11: { + LogStep(11, "Turn off light that we turned on"); + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); + } + case 12: { + LogStep(12, "Check on/off attribute value is false after off command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CC_4_2Suite : public TestCommand +{ +public: + Test_TC_CC_4_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_2", 48, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CC_4_2Suite() {} + + 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)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + 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; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + 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"); + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + case 1: { + LogStep(1, "Turn on light for color control tests"); + chip::app::Clusters::OnOff::Commands::On::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::On::Id, value); + } + case 2: { + LogStep(2, "Check on/off attribute value is true after on command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); + } + case 3: { + LogStep(3, "Check Saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 4: { + LogStep(4, "Move saturation up command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + } + case 5: { + LogStep(5, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 6: { + LogStep(6, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 7: { + LogStep(7, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 8: { + LogStep(8, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 9: { + LogStep(9, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 10: { + LogStep(10, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 11: { + LogStep(11, "Move saturation down command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(3); + value.rate = 5; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + } + case 12: { + LogStep(12, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 13: { + LogStep(13, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 14: { + LogStep(14, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 15: { + LogStep(15, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 16: { + LogStep(16, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 17: { + LogStep(17, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 18: { + LogStep(18, "Move saturation up command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(1); + value.rate = 5; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + } + case 19: { + LogStep(19, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 20: { + LogStep(20, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 21: { + LogStep(21, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 22: { + LogStep(22, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 23: { + LogStep(23, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 24: { + LogStep(24, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 25: { + LogStep(25, "Move saturation stop command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(0); + value.rate = 5; + value.optionsMask = 0; + value.optionsOverride = 0; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + } + case 26: { + LogStep(26, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 27: { + LogStep(27, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 28: { + LogStep(28, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 29: { + LogStep(29, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 30: { + LogStep(30, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 31: { + LogStep(31, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 32: { + LogStep(32, "Move saturation down command"); + chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; + value.moveMode = static_cast(3); + value.rate = 5; value.optionsMask = 0; value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); } - case 6: { - LogStep(6, "Move saturation stop command"); + case 33: { + LogStep(33, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 34: { + LogStep(34, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 35: { + LogStep(35, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 36: { + LogStep(36, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 37: { + LogStep(37, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 38: { + LogStep(38, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 39: { + LogStep(39, "Move saturation stop command"); chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; value.moveMode = static_cast(0); value.rate = 5; @@ -5247,31 +6315,40 @@ class Test_TC_CC_4_2Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); } - case 7: { - LogStep(7, "Move saturation down command"); - chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; - value.moveMode = static_cast(3); - value.rate = 5; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + case 40: { + LogStep(40, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); } - case 8: { - LogStep(8, "Move saturation stop command"); - chip::app::Clusters::ColorControl::Commands::MoveSaturation::Type value; - value.moveMode = static_cast(0); - value.rate = 5; - value.optionsMask = 0; - value.optionsOverride = 0; - return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveSaturation::Id, value); + case 41: { + LogStep(41, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); } - case 9: { - LogStep(9, "Turn off light that we turned on"); + case 42: { + LogStep(42, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 43: { + LogStep(43, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 44: { + LogStep(44, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 45: { + LogStep(45, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 46: { + LogStep(46, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 10: { - LogStep(10, "Check on/off attribute value is false after off command"); + case 47: { + LogStep(47, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5473,7 +6550,7 @@ class Test_TC_CC_4_3Suite : public TestCommand class Test_TC_CC_4_4Suite : public TestCommand { public: - Test_TC_CC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_4", 6, credsIssuerConfig) + Test_TC_CC_4_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_4_4", 11, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5523,11 +6600,55 @@ class Test_TC_CC_4_4Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5565,7 +6686,15 @@ class Test_TC_CC_4_4Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Move To current hue and saturation command"); + LogStep(3, "Check current hue attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 4: { + LogStep(4, "Check Saturation attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 5: { + LogStep(5, "Move To current hue and saturation command"); chip::app::Clusters::ColorControl::Commands::MoveToHueAndSaturation::Type value; value.hue = 40; value.saturation = 160; @@ -5575,13 +6704,26 @@ class Test_TC_CC_4_4Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToHueAndSaturation::Id, value); } - case 4: { - LogStep(4, "Turn off light that we turned on"); + case 6: { + LogStep(6, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 7: { + LogStep(7, "Check current hue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentHue::Id); + } + case 8: { + LogStep(8, "Check current saturation attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentSaturation::Id); + } + case 9: { + LogStep(9, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 5: { - LogStep(5, "Check on/off attribute value is false after off command"); + case 10: { + LogStep(10, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5592,7 +6734,7 @@ class Test_TC_CC_4_4Suite : public TestCommand class Test_TC_CC_5_1Suite : public TestCommand { public: - Test_TC_CC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_1", 6, credsIssuerConfig) + Test_TC_CC_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_1", 11, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5642,11 +6784,55 @@ class Test_TC_CC_5_1Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5684,7 +6870,15 @@ class Test_TC_CC_5_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Move to Color command"); + LogStep(3, "Check current x attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 4: { + LogStep(4, "Check current y attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 5: { + LogStep(5, "Move to Color command"); chip::app::Clusters::ColorControl::Commands::MoveToColor::Type value; value.colorX = 200U; value.colorY = 300U; @@ -5693,13 +6887,26 @@ class Test_TC_CC_5_1Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColor::Id, value); } - case 4: { - LogStep(4, "Turn off light that we turned on"); + case 6: { + LogStep(6, "Wait 20ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(20); + } + case 7: { + LogStep(7, "Check current x attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 8: { + LogStep(8, "Check current y attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 9: { + LogStep(9, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 5: { - LogStep(5, "Check on/off attribute value is false after off command"); + case 10: { + LogStep(10, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5710,7 +6917,7 @@ class Test_TC_CC_5_1Suite : public TestCommand class Test_TC_CC_5_2Suite : public TestCommand { public: - Test_TC_CC_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_2", 7, credsIssuerConfig) + Test_TC_CC_5_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_2", 14, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5760,14 +6967,78 @@ class Test_TC_CC_5_2Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5805,7 +7076,15 @@ class Test_TC_CC_5_2Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Move Color command"); + LogStep(3, "Check current x attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 4: { + LogStep(4, "Check current y attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 5: { + LogStep(5, "Move Color command"); chip::app::Clusters::ColorControl::Commands::MoveColor::Type value; value.rateX = 15; value.rateY = 20; @@ -5813,20 +7092,41 @@ class Test_TC_CC_5_2Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColor::Id, value); } - case 4: { - LogStep(4, "Stop Move Step command"); + case 6: { + LogStep(6, "Wait 150ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(150); + } + case 7: { + LogStep(7, "Check current x attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 8: { + LogStep(8, "Check current y attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 9: { + LogStep(9, "Stop Move Step command"); chip::app::Clusters::ColorControl::Commands::StopMoveStep::Type value; value.optionsMask = 0; value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StopMoveStep::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 10: { + LogStep(10, "Check current x attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 11: { + LogStep(11, "Check current y attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 12: { + LogStep(12, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 13: { + LogStep(13, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5837,7 +7137,7 @@ class Test_TC_CC_5_2Suite : public TestCommand class Test_TC_CC_5_3Suite : public TestCommand { public: - Test_TC_CC_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_3", 6, credsIssuerConfig) + Test_TC_CC_5_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_5_3", 11, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -5887,11 +7187,55 @@ class Test_TC_CC_5_3Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -5929,7 +7273,15 @@ class Test_TC_CC_5_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Step Color command"); + LogStep(3, "Check current x attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 4: { + LogStep(4, "Check current y attribute value matched before any change"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 5: { + LogStep(5, "Step Color command"); chip::app::Clusters::ColorControl::Commands::StepColor::Type value; value.stepX = 15; value.stepY = 20; @@ -5938,13 +7290,26 @@ class Test_TC_CC_5_3Suite : public TestCommand value.optionsOverride = 0; return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColor::Id, value); } - case 4: { - LogStep(4, "Turn off light that we turned on"); + case 6: { + LogStep(6, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 7: { + LogStep(7, "Check current x attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentX::Id); + } + case 8: { + LogStep(8, "Check current y attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::CurrentY::Id); + } + case 9: { + LogStep(9, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 5: { - LogStep(5, "Check on/off attribute value is false after off command"); + case 10: { + LogStep(10, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -5955,7 +7320,7 @@ class Test_TC_CC_5_3Suite : public TestCommand class Test_TC_CC_6_1Suite : public TestCommand { public: - Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 6, credsIssuerConfig) + Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6005,11 +7370,35 @@ class Test_TC_CC_6_1Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6047,7 +7436,11 @@ class Test_TC_CC_6_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Move To Color Temperature command"); + LogStep(3, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 4: { + LogStep(4, "Move To Color Temperature command"); chip::app::Clusters::ColorControl::Commands::MoveToColorTemperature::Type value; value.colorTemperature = 100U; value.transitionTime = 10U; @@ -6056,13 +7449,22 @@ class Test_TC_CC_6_1Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveToColorTemperature::Id, value); } - case 4: { - LogStep(4, "Turn off light that we turned on"); + case 5: { + LogStep(5, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 6: { + LogStep(6, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 7: { + LogStep(7, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 5: { - LogStep(5, "Check on/off attribute value is false after off command"); + case 8: { + LogStep(8, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6073,7 +7475,7 @@ class Test_TC_CC_6_1Suite : public TestCommand class Test_TC_CC_6_2Suite : public TestCommand { public: - Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 12, credsIssuerConfig) + Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 36, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6113,15 +7515,173 @@ class Test_TC_CC_6_2Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 2: + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 1)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + 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)); { - bool value; + uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("onOff", value, 1)); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } break; - case 3: + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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)); { uint16_t value; @@ -6131,28 +7691,38 @@ class Test_TC_CC_6_2Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); } 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: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 7: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; - case 8: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 9: + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; - case 10: + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6206,7 +7776,34 @@ class Test_TC_CC_6_2Suite : public TestCommand value); } case 5: { - LogStep(5, "Move down color temperature command"); + LogStep(5, "Wait 90ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(90); + } + case 6: { + LogStep(6, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 7: { + LogStep(7, "Wait 95ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(95); + } + case 8: { + LogStep(8, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 9: { + LogStep(9, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 10: { + LogStep(10, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 11: { + LogStep(11, "Move down color temperature command"); chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; value.moveMode = static_cast(3); value.rate = 20U; @@ -6217,8 +7814,35 @@ class Test_TC_CC_6_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, value); } - case 6: { - LogStep(6, "Move up color temperature command"); + case 12: { + LogStep(12, "Wait 190ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(190); + } + case 13: { + LogStep(13, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 14: { + LogStep(14, "Wait 195ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(195); + } + case 15: { + LogStep(15, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 16: { + LogStep(16, "Wait 200ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(200); + } + case 17: { + LogStep(17, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 18: { + LogStep(18, "Move up color temperature command"); chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; value.moveMode = static_cast(1); value.rate = 10U; @@ -6229,8 +7853,8 @@ class Test_TC_CC_6_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, value); } - case 7: { - LogStep(7, "Stop Color Temperature command"); + case 19: { + LogStep(19, "Stop Color Temperature command"); chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; value.moveMode = static_cast(0); value.rate = 10U; @@ -6241,8 +7865,35 @@ class Test_TC_CC_6_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, value); } - case 8: { - LogStep(8, "Move down color temperature command"); + case 20: { + LogStep(20, "Wait 90ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(90); + } + case 21: { + LogStep(21, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 22: { + LogStep(22, "Wait 95ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(95); + } + case 23: { + LogStep(23, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 24: { + LogStep(24, "Wait 100ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(100); + } + case 25: { + LogStep(25, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 26: { + LogStep(26, "Move down color temperature command"); chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; value.moveMode = static_cast(3); value.rate = 20U; @@ -6253,8 +7904,8 @@ class Test_TC_CC_6_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, value); } - case 9: { - LogStep(9, "Stop Color Temperature command"); + case 27: { + LogStep(27, "Stop Color Temperature command"); chip::app::Clusters::ColorControl::Commands::MoveColorTemperature::Type value; value.moveMode = static_cast(0); value.rate = 10U; @@ -6265,13 +7916,40 @@ class Test_TC_CC_6_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::MoveColorTemperature::Id, value); } - case 10: { - LogStep(10, "Turn off light that we turned on"); + case 28: { + LogStep(28, "Wait 140ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(140); + } + case 29: { + LogStep(29, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 30: { + LogStep(30, "Wait 145ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(145); + } + case 31: { + LogStep(31, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 32: { + LogStep(32, "Wait 150ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(150); + } + case 33: { + LogStep(33, "Read current color temprature attribute from DUT several times"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 34: { + LogStep(34, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 11: { - LogStep(11, "Check on/off attribute value is false after off command"); + case 35: { + LogStep(35, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6282,7 +7960,7 @@ class Test_TC_CC_6_2Suite : public TestCommand class Test_TC_CC_6_3Suite : public TestCommand { public: - Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 7, credsIssuerConfig) + Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 20, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6332,14 +8010,108 @@ class Test_TC_CC_6_3Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65279U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6377,7 +8149,11 @@ class Test_TC_CC_6_3Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Step up color temperature command"); + LogStep(3, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 4: { + LogStep(4, "Step up color temperature command"); chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type value; value.stepMode = static_cast(1); value.stepSize = 5U; @@ -6389,8 +8165,35 @@ class Test_TC_CC_6_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColorTemperature::Id, value); } - case 4: { - LogStep(4, "Step down color temperature command"); + case 5: { + LogStep(5, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 6: { + LogStep(6, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 7: { + LogStep(7, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 8: { + LogStep(8, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 9: { + LogStep(9, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 10: { + LogStep(10, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 11: { + LogStep(11, "Step down color temperature command"); chip::app::Clusters::ColorControl::Commands::StepColorTemperature::Type value; value.stepMode = static_cast(3); value.stepSize = 5U; @@ -6402,13 +8205,40 @@ class Test_TC_CC_6_3Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::StepColorTemperature::Id, value); } - case 5: { - LogStep(5, "Turn off light that we turned on"); + case 12: { + LogStep(12, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 13: { + LogStep(13, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 14: { + LogStep(14, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 15: { + LogStep(15, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 16: { + LogStep(16, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 17: { + LogStep(17, "Read current color temprature"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::ColorTemperature::Id); + } + case 18: { + LogStep(18, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 6: { - LogStep(6, "Check on/off attribute value is false after off command"); + case 19: { + LogStep(19, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6419,7 +8249,7 @@ class Test_TC_CC_6_3Suite : public TestCommand class Test_TC_CC_7_1Suite : public TestCommand { public: - Test_TC_CC_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_1", 10, credsIssuerConfig) + Test_TC_CC_7_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_1", 35, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6472,20 +8302,198 @@ class Test_TC_CC_7_1Suite : public TestCommand break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + 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)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + 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)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6534,7 +8542,12 @@ class Test_TC_CC_7_1Suite : public TestCommand value); } case 4: { - LogStep(4, "Enhanced Move To Hue command"); + LogStep(4, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 5: { + LogStep(5, "Enhanced Move To Hue command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; value.enhancedHue = 1100U; value.direction = static_cast(0); @@ -6544,8 +8557,38 @@ class Test_TC_CC_7_1Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, value); } - case 5: { - LogStep(5, "Enhanced Move To Hue command"); + case 6: { + LogStep(6, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 7: { + LogStep(7, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 8: { + LogStep(8, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 9: { + LogStep(9, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 10: { + LogStep(10, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 11: { + LogStep(11, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 12: { + LogStep(12, "Enhanced Move To Hue command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; value.enhancedHue = 1150U; value.direction = static_cast(1); @@ -6555,8 +8598,38 @@ class Test_TC_CC_7_1Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, value); } - case 6: { - LogStep(6, "Enhanced Move To Hue command"); + case 13: { + LogStep(13, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 14: { + LogStep(14, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 15: { + LogStep(15, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 16: { + LogStep(16, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 17: { + LogStep(17, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 18: { + LogStep(18, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 19: { + LogStep(19, "Enhanced Move To Hue command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; value.enhancedHue = 1200U; value.direction = static_cast(2); @@ -6566,8 +8639,38 @@ class Test_TC_CC_7_1Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, value); } - case 7: { - LogStep(7, "Enhanced Move To Hue command"); + case 20: { + LogStep(20, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 21: { + LogStep(21, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 22: { + LogStep(22, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 23: { + LogStep(23, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 24: { + LogStep(24, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 25: { + LogStep(25, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 26: { + LogStep(26, "Enhanced Move To Hue command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHue::Type value; value.enhancedHue = 1300U; value.direction = static_cast(3); @@ -6577,13 +8680,43 @@ class Test_TC_CC_7_1Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHue::Id, value); } - case 8: { - LogStep(8, "Turn off light that we turned on"); + case 27: { + LogStep(27, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 28: { + LogStep(28, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 29: { + LogStep(29, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 30: { + LogStep(30, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 31: { + LogStep(31, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 32: { + LogStep(32, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 33: { + LogStep(33, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 9: { - LogStep(9, "Check on/off attribute value is false after off command"); + case 34: { + LogStep(34, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6594,7 +8727,7 @@ class Test_TC_CC_7_1Suite : public TestCommand class Test_TC_CC_7_2Suite : public TestCommand { public: - Test_TC_CC_7_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_2", 10, credsIssuerConfig) + Test_TC_CC_7_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_2", 24, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -6657,17 +8790,121 @@ class Test_TC_CC_7_2Suite : public TestCommand break; case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } break; case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -6720,7 +8957,37 @@ class Test_TC_CC_7_2Suite : public TestCommand value); } case 5: { - LogStep(5, "Enhanced Move Hue Stop command"); + LogStep(5, "Wait 290ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(290); + } + case 6: { + LogStep(6, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 7: { + LogStep(7, "Wait 295ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(295); + } + case 8: { + LogStep(8, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 9: { + LogStep(9, "Wait 300ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(300); + } + case 10: { + LogStep(10, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 11: { + LogStep(11, "Enhanced Move Hue Stop command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; value.moveMode = static_cast(0); value.rate = 0U; @@ -6729,8 +8996,13 @@ class Test_TC_CC_7_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value); } - case 6: { - LogStep(6, "Enhanced Move Hue Down command "); + case 12: { + LogStep(12, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 13: { + LogStep(13, "Enhanced Move Hue Down command "); chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; value.moveMode = static_cast(3); value.rate = 5U; @@ -6739,8 +9011,38 @@ class Test_TC_CC_7_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value); } - case 7: { - LogStep(7, "Enhanced Move Hue Stop command"); + case 14: { + LogStep(14, "Wait 40ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(40); + } + case 15: { + LogStep(15, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 16: { + LogStep(16, "Wait 45ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(45); + } + case 17: { + LogStep(17, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 18: { + LogStep(18, "Wait 50ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(50); + } + case 19: { + LogStep(19, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 20: { + LogStep(20, "Enhanced Move Hue Stop command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveHue::Type value; value.moveMode = static_cast(0); value.rate = 0U; @@ -6749,13 +9051,18 @@ class Test_TC_CC_7_2Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveHue::Id, value); } - case 8: { - LogStep(8, "Turn off light that we turned on"); + case 21: { + LogStep(21, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 22: { + LogStep(22, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 9: { - LogStep(9, "Check on/off attribute value is false after off command"); + case 23: { + LogStep(23, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } @@ -6962,7 +9269,7 @@ class Test_TC_CC_7_3Suite : public TestCommand class Test_TC_CC_7_4Suite : public TestCommand { public: - Test_TC_CC_7_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_4", 6, credsIssuerConfig) + Test_TC_CC_7_4Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_7_4", 9, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -7012,11 +9319,35 @@ class Test_TC_CC_7_4Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -7054,7 +9385,12 @@ class Test_TC_CC_7_4Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } case 3: { - LogStep(3, "Enhanced move to hue and saturation command"); + LogStep(3, "Reads EnhancedCurrentHue attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 4: { + LogStep(4, "Enhanced move to hue and saturation command"); chip::app::Clusters::ColorControl::Commands::EnhancedMoveToHueAndSaturation::Type value; value.enhancedHue = 1200U; value.saturation = 90; @@ -7064,13 +9400,23 @@ class Test_TC_CC_7_4Suite : public TestCommand return SendCommand(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Commands::EnhancedMoveToHueAndSaturation::Id, value); } - case 4: { - LogStep(4, "Turn off light that we turned on"); + case 5: { + LogStep(5, "Wait 10ms"); + SetIdentity(kIdentityAlpha); + return WaitForMs(10); + } + case 6: { + LogStep(6, "Check EnhancedCurrentHue attribute value matched the value sent by the last command"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, + ColorControl::Attributes::EnhancedCurrentHue::Id); + } + case 7: { + LogStep(7, "Turn off light that we turned on"); chip::app::Clusters::OnOff::Commands::Off::Type value; return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value); } - case 5: { - LogStep(5, "Check on/off attribute value is false after off command"); + case 8: { + LogStep(8, "Check on/off attribute value is false after off command"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id); } } From 94756b033a7d3a7129191157dfd4643c353ec4f8 Mon Sep 17 00:00:00 2001 From: krypton36 Date: Fri, 6 May 2022 18:16:53 -0700 Subject: [PATCH 16/19] Update chip-tool-darwin to allow optionals in CLI (#18168) * Update chip-tool-darwin to set optional params in CLI * Generated Code --- .../chip-tool-darwin/templates/commands.zapt | 34 ++- .../zap-generated/cluster/Commands.h | 234 ++++++++++++------ 2 files changed, 183 insertions(+), 85 deletions(-) diff --git a/examples/chip-tool-darwin/templates/commands.zapt b/examples/chip-tool-darwin/templates/commands.zapt index f883d41b8342b3..b1f8d013d227b5 100644 --- a/examples/chip-tool-darwin/templates/commands.zapt +++ b/examples/chip-tool-darwin/templates/commands.zapt @@ -54,12 +54,30 @@ public: {{#chip_cluster_command_arguments}} {{#if_chip_complex}} {{>decodable_value target=(concat "params." (asStructPropertyName label)) source=(concat "mRequest." (asStructPropertyName label)) cluster=parent.clusterName type=type depth=0}} - {{else if (isOctetString type)}} - params.{{asStructPropertyName label}} = [[NSData alloc] initWithBytes:m{{asUpperCamelCase label}}.data() length:m{{asUpperCamelCase label}}.size()]; + {{else if (isOctetString type)}} + {{#if isOptional}} + if (m{{asUpperCamelCase label}}.HasValue()) { + {{/if}} + params.{{asStructPropertyName label}} = [[NSData alloc] initWithBytes:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.data() length:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.size()]; + {{#if isOptional}} + } + {{/if}} {{else if (isString type)}} - params.{{asStructPropertyName label}} = [[NSString alloc] initWithBytes:m{{asUpperCamelCase label}}.data() length:m{{asUpperCamelCase label}}.size() encoding:NSUTF8StringEncoding]; + {{#if isOptional}} + if (m{{asUpperCamelCase label}}.HasValue()) { + {{/if}} + params.{{asStructPropertyName label}} = [[NSString alloc] initWithBytes:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.data() length:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}.size() encoding:NSUTF8StringEncoding]; + {{#if isOptional}} + } + {{/if}} {{else}} - params.{{asStructPropertyName label}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:m{{asUpperCamelCase label}}]; + {{#if isOptional}} + if (m{{asUpperCamelCase label}}.HasValue()) { + {{/if}} + params.{{asStructPropertyName label}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:m{{asUpperCamelCase label}}{{#if isOptional}}.Value(){{/if}}]; + {{#if isOptional}} + } + {{/if}} {{/if_chip_complex}} {{/chip_cluster_command_arguments}} uint16_t repeatCount = mRepeatCount.ValueOr(1); @@ -92,12 +110,10 @@ private: {{#if_chip_complex}} chip::app::Clusters::{{asUpperCamelCase parent.clusterName}}::Commands::{{asUpperCamelCase parent.name}}::Type mRequest; TypedComplexArgument<{{zapTypeToEncodableClusterObjectType type ns=parent.parent.name}}> mComplex_{{asUpperCamelCase label}}; - {{else if (isOctetString type)}} - chip::ByteSpan m{{asUpperCamelCase label}}; - {{else if (isCharString type)}} - chip::ByteSpan m{{asUpperCamelCase label}}; + {{else if (isString type)}} + {{#if isOptional}}chip::Optional{{else}}chip::ByteSpan{{/if}} m{{asUpperCamelCase label}}; {{else}} - {{chipType}} m{{asUpperCamelCase label}}; + {{#if isOptional}}chip::Optional<{{chipType}}>{{else}}{{chipType}}{{/if}} m{{asUpperCamelCase label}}; {{/if_chip_complex}} {{/chip_cluster_command_arguments}} }; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h index a3751e9eeaadd7..f79f8005191590 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -3141,7 +3141,9 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { params.application.applicationId = [[NSString alloc] initWithBytes:mRequest.application.applicationId.data() length:mRequest.application.applicationId.size() encoding:NSUTF8StringEncoding]; - params.data = [[NSData alloc] initWithBytes:mData.data() length:mData.size()]; + if (mData.HasValue()) { + params.data = [[NSData alloc] initWithBytes:mData.Value().data() length:mData.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -3166,7 +3168,7 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { private: chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; TypedComplexArgument mComplex_Application; - chip::ByteSpan mData; + chip::Optional mData; }; /* @@ -8290,7 +8292,9 @@ class BridgedActionsDisableAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8312,7 +8316,7 @@ class BridgedActionsDisableAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8340,7 +8344,9 @@ class BridgedActionsDisableActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8363,7 +8369,7 @@ class BridgedActionsDisableActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8391,7 +8397,9 @@ class BridgedActionsEnableAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8413,7 +8421,7 @@ class BridgedActionsEnableAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8441,7 +8449,9 @@ class BridgedActionsEnableActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8464,7 +8474,7 @@ class BridgedActionsEnableActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8492,7 +8502,9 @@ class BridgedActionsInstantAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8514,7 +8526,7 @@ class BridgedActionsInstantAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8542,7 +8554,9 @@ class BridgedActionsInstantActionWithTransition : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.transitionTime = [NSNumber numberWithUnsignedShort:mTransitionTime]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8565,7 +8579,7 @@ class BridgedActionsInstantActionWithTransition : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint16_t mTransitionTime; }; @@ -8593,7 +8607,9 @@ class BridgedActionsPauseAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8615,7 +8631,7 @@ class BridgedActionsPauseAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8643,7 +8659,9 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8666,7 +8684,7 @@ class BridgedActionsPauseActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8694,7 +8712,9 @@ class BridgedActionsResumeAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8716,7 +8736,7 @@ class BridgedActionsResumeAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8743,7 +8763,9 @@ class BridgedActionsStartAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8765,7 +8787,7 @@ class BridgedActionsStartAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -8793,7 +8815,9 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } params.duration = [NSNumber numberWithUnsignedInt:mDuration]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -8816,7 +8840,7 @@ class BridgedActionsStartActionWithDuration : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; uint32_t mDuration; }; @@ -8844,7 +8868,9 @@ class BridgedActionsStopAction : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.actionID = [NSNumber numberWithUnsignedShort:mActionID]; - params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID]; + if (mInvokeID.HasValue()) { + params.invokeID = [NSNumber numberWithUnsignedInt:mInvokeID.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -8866,7 +8892,7 @@ class BridgedActionsStopAction : public ClusterCommand { private: uint16_t mActionID; - uint32_t mInvokeID; + chip::Optional mInvokeID; }; /* @@ -17232,7 +17258,11 @@ class ContentLauncherLaunchContent : public ClusterCommand { params.search.parameterList = array_1; } params.autoPlay = [NSNumber numberWithBool:mAutoPlay]; - params.data = [[NSString alloc] initWithBytes:mData.data() length:mData.size() encoding:NSUTF8StringEncoding]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -17258,7 +17288,7 @@ class ContentLauncherLaunchContent : public ClusterCommand { chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type mRequest; TypedComplexArgument mComplex_Search; bool mAutoPlay; - chip::ByteSpan mData; + chip::Optional mData; }; /* @@ -17289,9 +17319,11 @@ class ContentLauncherLaunchURL : public ClusterCommand { params.contentURL = [[NSString alloc] initWithBytes:mContentURL.data() length:mContentURL.size() encoding:NSUTF8StringEncoding]; - params.displayString = [[NSString alloc] initWithBytes:mDisplayString.data() - length:mDisplayString.size() - encoding:NSUTF8StringEncoding]; + if (mDisplayString.HasValue()) { + params.displayString = [[NSString alloc] initWithBytes:mDisplayString.Value().data() + length:mDisplayString.Value().size() + encoding:NSUTF8StringEncoding]; + } if (mRequest.brandingInformation.HasValue()) { params.brandingInformation = [CHIPContentLauncherClusterBrandingInformation new]; params.brandingInformation.providerName = @@ -17489,7 +17521,7 @@ class ContentLauncherLaunchURL : public ClusterCommand { private: chip::ByteSpan mContentURL; - chip::ByteSpan mDisplayString; + chip::Optional mDisplayString; chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type mRequest; TypedComplexArgument> mComplex_BrandingInformation; @@ -19439,7 +19471,9 @@ class DoorLockLockDoor : public ClusterCommand { __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -19460,7 +19494,7 @@ class DoorLockLockDoor : public ClusterCommand { } private: - chip::ByteSpan mPinCode; + chip::Optional mPinCode; }; /* @@ -19791,7 +19825,9 @@ class DoorLockUnlockDoor : public ClusterCommand { __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -19812,7 +19848,7 @@ class DoorLockUnlockDoor : public ClusterCommand { } private: - chip::ByteSpan mPinCode; + chip::Optional mPinCode; }; /* @@ -19839,7 +19875,9 @@ class DoorLockUnlockWithTimeout : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.timeout = [NSNumber numberWithUnsignedShort:mTimeout]; - params.pinCode = [[NSData alloc] initWithBytes:mPinCode.data() length:mPinCode.size()]; + if (mPinCode.HasValue()) { + params.pinCode = [[NSData alloc] initWithBytes:mPinCode.Value().data() length:mPinCode.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -19861,7 +19899,7 @@ class DoorLockUnlockWithTimeout : public ClusterCommand { private: uint16_t mTimeout; - chip::ByteSpan mPinCode; + chip::Optional mPinCode; }; /* @@ -37726,7 +37764,9 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.operationalDataset = [[NSData alloc] initWithBytes:mOperationalDataset.data() length:mOperationalDataset.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37751,7 +37791,7 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { private: chip::ByteSpan mOperationalDataset; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37782,7 +37822,9 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; params.credentials = [[NSData alloc] initWithBytes:mCredentials.data() length:mCredentials.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37808,7 +37850,7 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { private: chip::ByteSpan mSsid; chip::ByteSpan mCredentials; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37837,7 +37879,9 @@ class NetworkCommissioningConnectNetwork : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37861,7 +37905,7 @@ class NetworkCommissioningConnectNetwork : public ClusterCommand { private: chip::ByteSpan mNetworkID; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37890,7 +37934,9 @@ class NetworkCommissioningRemoveNetwork : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37914,7 +37960,7 @@ class NetworkCommissioningRemoveNetwork : public ClusterCommand { private: chip::ByteSpan mNetworkID; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37945,7 +37991,9 @@ class NetworkCommissioningReorderNetwork : public ClusterCommand { = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.networkID = [[NSData alloc] initWithBytes:mNetworkID.data() length:mNetworkID.size()]; params.networkIndex = [NSNumber numberWithUnsignedChar:mNetworkIndex]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -37970,7 +38018,7 @@ class NetworkCommissioningReorderNetwork : public ClusterCommand { private: chip::ByteSpan mNetworkID; uint8_t mNetworkIndex; - uint64_t mBreadcrumb; + chip::Optional mBreadcrumb; }; /* @@ -37998,8 +38046,12 @@ class NetworkCommissioningScanNetworks : public ClusterCommand { __auto_type * params = [[CHIPNetworkCommissioningClusterScanNetworksParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.ssid = [[NSData alloc] initWithBytes:mSsid.data() length:mSsid.size()]; - params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb]; + if (mSsid.HasValue()) { + params.ssid = [[NSData alloc] initWithBytes:mSsid.Value().data() length:mSsid.Value().size()]; + } + if (mBreadcrumb.HasValue()) { + params.breadcrumb = [NSNumber numberWithUnsignedLongLong:mBreadcrumb.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -38022,8 +38074,8 @@ class NetworkCommissioningScanNetworks : public ClusterCommand { } private: - chip::ByteSpan mSsid; - uint64_t mBreadcrumb; + chip::Optional mSsid; + chip::Optional mBreadcrumb; }; /* @@ -39131,10 +39183,21 @@ class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { } params.protocolsSupported = array_0; } - params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion]; - params.location = [[NSString alloc] initWithBytes:mLocation.data() length:mLocation.size() encoding:NSUTF8StringEncoding]; - params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent]; - params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.data() length:mMetadataForProvider.size()]; + if (mHardwareVersion.HasValue()) { + params.hardwareVersion = [NSNumber numberWithUnsignedShort:mHardwareVersion.Value()]; + } + if (mLocation.HasValue()) { + params.location = [[NSString alloc] initWithBytes:mLocation.Value().data() + length:mLocation.Value().size() + encoding:NSUTF8StringEncoding]; + } + if (mRequestorCanConsent.HasValue()) { + params.requestorCanConsent = [NSNumber numberWithBool:mRequestorCanConsent.Value()]; + } + if (mMetadataForProvider.HasValue()) { + params.metadataForProvider = [[NSData alloc] initWithBytes:mMetadataForProvider.Value().data() + length:mMetadataForProvider.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -39163,10 +39226,10 @@ class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type mRequest; TypedComplexArgument> mComplex_ProtocolsSupported; - uint16_t mHardwareVersion; - chip::ByteSpan mLocation; - bool mRequestorCanConsent; - chip::ByteSpan mMetadataForProvider; + chip::Optional mHardwareVersion; + chip::Optional mLocation; + chip::Optional mRequestorCanConsent; + chip::Optional mMetadataForProvider; }; /* @@ -39373,7 +39436,10 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ClusterCommand { params.providerNodeId = [NSNumber numberWithUnsignedLongLong:mProviderNodeId]; params.vendorId = [NSNumber numberWithUnsignedShort:mVendorId]; params.announcementReason = [NSNumber numberWithUnsignedChar:mAnnouncementReason]; - params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.data() length:mMetadataForNode.size()]; + if (mMetadataForNode.HasValue()) { + params.metadataForNode = [[NSData alloc] initWithBytes:mMetadataForNode.Value().data() + length:mMetadataForNode.Value().size()]; + } params.endpoint = [NSNumber numberWithUnsignedShort:mEndpoint]; uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; @@ -39398,7 +39464,7 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ClusterCommand { chip::NodeId mProviderNodeId; chip::VendorId mVendorId; uint8_t mAnnouncementReason; - chip::ByteSpan mMetadataForNode; + chip::Optional mMetadataForNode; chip::EndpointId mEndpoint; }; @@ -42146,7 +42212,9 @@ class OperationalCredentialsAddNOC : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; - params.icacValue = [[NSData alloc] initWithBytes:mICACValue.data() length:mICACValue.size()]; + if (mICACValue.HasValue()) { + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; + } params.ipkValue = [[NSData alloc] initWithBytes:mIPKValue.data() length:mIPKValue.size()]; params.caseAdminNode = [NSNumber numberWithUnsignedLongLong:mCaseAdminNode]; params.adminVendorId = [NSNumber numberWithUnsignedShort:mAdminVendorId]; @@ -42173,7 +42241,7 @@ class OperationalCredentialsAddNOC : public ClusterCommand { private: chip::ByteSpan mNOCValue; - chip::ByteSpan mICACValue; + chip::Optional mICACValue; chip::ByteSpan mIPKValue; chip::NodeId mCaseAdminNode; uint16_t mAdminVendorId; @@ -42553,7 +42621,9 @@ class OperationalCredentialsUpdateNOC : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.nocValue = [[NSData alloc] initWithBytes:mNOCValue.data() length:mNOCValue.size()]; - params.icacValue = [[NSData alloc] initWithBytes:mICACValue.data() length:mICACValue.size()]; + if (mICACValue.HasValue()) { + params.icacValue = [[NSData alloc] initWithBytes:mICACValue.Value().data() length:mICACValue.Value().size()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -42577,7 +42647,7 @@ class OperationalCredentialsUpdateNOC : public ClusterCommand { private: chip::ByteSpan mNOCValue; - chip::ByteSpan mICACValue; + chip::Optional mICACValue; }; /* @@ -50572,7 +50642,11 @@ class TargetNavigatorNavigateTarget : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.target = [NSNumber numberWithUnsignedChar:mTarget]; - params.data = [[NSString alloc] initWithBytes:mData.data() length:mData.size() encoding:NSUTF8StringEncoding]; + if (mData.HasValue()) { + params.data = [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -50596,7 +50670,7 @@ class TargetNavigatorNavigateTarget : public ClusterCommand { private: uint8_t mTarget; - chip::ByteSpan mData; + chip::Optional mData; }; /* @@ -52408,7 +52482,9 @@ class TestClusterTestNullableOptionalRequest : public ClusterCommand { __auto_type * params = [[CHIPTestClusterClusterTestNullableOptionalRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithUnsignedChar:mArg1]; + if (mArg1.HasValue()) { + params.arg1 = [NSNumber numberWithUnsignedChar:mArg1.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -52432,7 +52508,7 @@ class TestClusterTestNullableOptionalRequest : public ClusterCommand { } private: - uint8_t mArg1; + chip::Optional mArg1; }; /* @@ -52457,7 +52533,9 @@ class TestClusterTestSimpleOptionalArgumentRequest : public ClusterCommand { __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.arg1 = [NSNumber numberWithBool:mArg1]; + if (mArg1.HasValue()) { + params.arg1 = [NSNumber numberWithBool:mArg1.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -52478,7 +52556,7 @@ class TestClusterTestSimpleOptionalArgumentRequest : public ClusterCommand { } private: - bool mArg1; + chip::Optional mArg1; }; /* @@ -73345,7 +73423,9 @@ class WindowCoveringGoToLiftPercentage : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.liftPercentageValue = [NSNumber numberWithUnsignedChar:mLiftPercentageValue]; - params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue]; + if (mLiftPercent100thsValue.HasValue()) { + params.liftPercent100thsValue = [NSNumber numberWithUnsignedShort:mLiftPercent100thsValue.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -73367,7 +73447,7 @@ class WindowCoveringGoToLiftPercentage : public ClusterCommand { private: chip::Percent mLiftPercentageValue; - chip::Percent100ths mLiftPercent100thsValue; + chip::Optional mLiftPercent100thsValue; }; /* @@ -73440,7 +73520,9 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.tiltPercentageValue = [NSNumber numberWithUnsignedChar:mTiltPercentageValue]; - params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue]; + if (mTiltPercent100thsValue.HasValue()) { + params.tiltPercent100thsValue = [NSNumber numberWithUnsignedShort:mTiltPercent100thsValue.Value()]; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -73462,7 +73544,7 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { private: chip::Percent mTiltPercentageValue; - chip::Percent100ths mTiltPercent100thsValue; + chip::Optional mTiltPercent100thsValue; }; /* From c52a03015920cfc370c3b0c676964ddd20672c3b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 7 May 2022 02:04:31 -0400 Subject: [PATCH 17/19] Enable various power source attributes in controllers. (#18120) Fixes https://github.com/project-chip/connectedhomeip/issues/13758 --- .../data_model/controller-clusters.matter | 22 + .../data_model/controller-clusters.zap | 1041 +++++++++- .../CHIPAttributeTLVValueDecoder.cpp | 339 ++++ .../java/zap-generated/CHIPCallbackTypes.h | 44 + .../java/zap-generated/CHIPReadCallbacks.cpp | 142 ++ .../java/zap-generated/CHIPReadCallbacks.h | 60 + .../chip/devicecontroller/ChipClusters.java | 370 ++++ .../chip/devicecontroller/ChipIdLookup.java | 66 + .../devicecontroller/ClusterInfoMapping.java | 50 + .../devicecontroller/ClusterReadMapping.java | 300 +++ .../python/chip/clusters/CHIPClusters.py | 132 ++ .../CHIPAttributeTLVValueDecoder.mm | 272 +++ .../CHIP/zap-generated/CHIPCallbackBridge.mm | 78 + .../CHIPCallbackBridge_internal.h | 57 + .../CHIP/zap-generated/CHIPClustersObjc.h | 412 ++++ .../CHIP/zap-generated/CHIPClustersObjc.mm | 1619 +++++++++++++-- .../cluster/CHIPTestClustersObjc.h | 36 + .../cluster/CHIPTestClustersObjc.mm | 451 +++++ .../zap-generated/cluster/Commands.h | 1727 ++++++++++++++++- .../zap-generated/CHIPClientCallbacks.h | 10 + 20 files changed, 7033 insertions(+), 195 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 9d9ef2022d3009..26b407a8e83406 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3028,12 +3028,34 @@ client cluster PowerSource = 47 { readonly attribute enum8 status = 0; readonly attribute int8u order = 1; readonly attribute char_string<60> description = 2; + readonly attribute int32u wiredAssessedInputVoltage = 3; + readonly attribute int16u wiredAssessedInputFrequency = 4; + readonly attribute enum8 wiredCurrentType = 5; + readonly attribute int32u wiredAssessedCurrent = 6; + readonly attribute int32u wiredNominalVoltage = 7; + readonly attribute int32u wiredMaximumCurrent = 8; + readonly attribute boolean wiredPresent = 9; + readonly attribute ENUM8 activeWiredFaults[] = 10; readonly attribute int32u batteryVoltage = 11; readonly attribute int8u batteryPercentRemaining = 12; readonly attribute int32u batteryTimeRemaining = 13; readonly attribute enum8 batteryChargeLevel = 14; + readonly attribute boolean batteryReplacementNeeded = 15; + readonly attribute enum8 batteryReplaceability = 16; + readonly attribute boolean batteryPresent = 17; readonly attribute ENUM8 activeBatteryFaults[] = 18; + readonly attribute char_string<60> batteryReplacementDescription = 19; + readonly attribute int32u batteryCommonDesignation = 20; + readonly attribute char_string<20> batteryANSIDesignation = 21; + readonly attribute char_string<20> batteryIECDesignation = 22; + readonly attribute int32u batteryApprovedChemistry = 23; + readonly attribute int32u batteryCapacity = 24; + readonly attribute int8u batteryQuantity = 25; readonly attribute enum8 batteryChargeState = 26; + readonly attribute int32u batteryTimeToFullCharge = 27; + readonly attribute boolean batteryFunctionalWhileCharging = 28; + readonly attribute int32u batteryChargingCurrent = 29; + readonly attribute ENUM8 activeBatteryChargeFaults[] = 30; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute attrib_id attributeList[] = 65531; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 086d975d3d34e5..06629bdf4e102f 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -75,6 +75,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -110,6 +111,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -125,6 +127,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -140,6 +143,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -155,6 +159,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -170,6 +175,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -185,6 +191,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -260,6 +267,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -319,6 +327,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -334,6 +343,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -349,6 +359,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -364,6 +375,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -379,6 +391,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -394,6 +407,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -477,6 +491,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -492,6 +507,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -567,6 +583,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -582,6 +599,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -597,6 +615,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -612,6 +631,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -627,6 +647,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -642,6 +663,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "node_id", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -657,6 +679,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -672,6 +695,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -687,6 +711,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -702,6 +727,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -717,6 +743,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -792,6 +819,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -818,6 +846,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -833,6 +862,7 @@ "code": 16384, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -848,6 +878,7 @@ "code": 16385, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -863,6 +894,7 @@ "code": 16386, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -878,6 +910,7 @@ "code": 16387, "mfgCode": null, "side": "server", + "type": "OnOffStartUpOnOff", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -893,6 +926,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -908,6 +942,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -923,6 +958,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -938,6 +974,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -953,6 +990,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -979,6 +1017,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1005,6 +1044,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1020,6 +1060,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1035,6 +1076,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1050,6 +1092,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1065,6 +1108,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1080,6 +1124,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1095,6 +1140,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1186,6 +1232,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1201,6 +1248,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1227,6 +1275,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1242,6 +1291,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1257,6 +1307,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1272,6 +1323,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1287,6 +1339,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1302,6 +1355,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1317,6 +1371,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1332,6 +1387,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1347,6 +1403,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1362,6 +1419,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1377,6 +1435,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1392,6 +1451,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1407,6 +1467,7 @@ "code": 20, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1422,6 +1483,7 @@ "code": 16384, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1437,6 +1499,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1452,6 +1515,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1467,6 +1531,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1482,6 +1547,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1497,6 +1563,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1523,6 +1590,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1549,6 +1617,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "char_string", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1564,6 +1633,7 @@ "code": 28, "mfgCode": null, "side": "server", + "type": "char_string", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1579,6 +1649,7 @@ "code": 46, "mfgCode": null, "side": "server", + "type": "char_string", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1594,6 +1665,7 @@ "code": 81, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1609,6 +1681,7 @@ "code": 84, "mfgCode": null, "side": "server", + "type": "enum8", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1624,6 +1697,7 @@ "code": 85, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1639,6 +1713,7 @@ "code": 103, "mfgCode": null, "side": "server", + "type": "enum8", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1654,6 +1729,7 @@ "code": 111, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1669,6 +1745,7 @@ "code": 256, "mfgCode": null, "side": "server", + "type": "int32u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1684,6 +1761,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1699,6 +1777,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1714,6 +1793,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1729,6 +1809,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1744,6 +1825,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1770,6 +1852,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1796,6 +1879,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1811,6 +1895,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1826,6 +1911,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1841,6 +1927,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1856,6 +1943,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1871,6 +1959,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1886,6 +1975,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1901,6 +1991,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -1916,6 +2007,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -1942,6 +2034,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -1968,6 +2061,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1983,6 +2077,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -1998,6 +2093,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2013,6 +2109,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2028,6 +2125,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2043,6 +2141,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2069,6 +2168,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -2095,6 +2195,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2110,6 +2211,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2125,6 +2227,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -2140,6 +2243,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -2155,6 +2259,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -2170,6 +2275,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2185,6 +2291,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2200,6 +2307,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2215,6 +2323,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2230,6 +2339,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -2353,6 +2463,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -2379,6 +2490,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2394,6 +2506,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2409,6 +2522,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "long_char_string", "included": 1, "storageOption": "External", "singleton": 0, @@ -2424,6 +2538,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2439,6 +2554,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2454,6 +2570,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -2469,6 +2586,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2484,6 +2602,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -2510,6 +2629,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 1, @@ -2536,6 +2656,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 1, @@ -2551,6 +2672,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2566,6 +2688,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "vendor_id", "included": 1, "storageOption": "External", "singleton": 1, @@ -2581,6 +2704,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2596,6 +2720,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 1, @@ -2611,6 +2736,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "NVM", "singleton": 1, @@ -2626,6 +2752,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2641,6 +2768,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 1, @@ -2656,6 +2784,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2671,6 +2800,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 1, @@ -2686,6 +2816,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2701,6 +2832,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2716,6 +2848,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2731,6 +2864,7 @@ "code": 13, "mfgCode": null, "side": "server", + "type": "long_char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2746,6 +2880,7 @@ "code": 14, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2761,6 +2896,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2776,6 +2912,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "NVM", "singleton": 1, @@ -2791,6 +2928,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 1, @@ -2806,6 +2944,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "External", "singleton": 1, @@ -2821,6 +2960,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "CapabilityMinimaStruct", "included": 1, "storageOption": "External", "singleton": 0, @@ -2836,6 +2976,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 1, @@ -2851,6 +2992,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 1, @@ -2866,6 +3008,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 1, @@ -2881,6 +3024,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 1, @@ -2896,6 +3040,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 1, @@ -2947,6 +3092,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -2962,6 +3108,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3005,6 +3152,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3020,6 +3168,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3055,6 +3204,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -3070,6 +3220,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3096,6 +3247,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3111,6 +3263,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "External", "singleton": 0, @@ -3126,6 +3279,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "OTAUpdateStateEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -3141,6 +3295,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "External", "singleton": 0, @@ -3156,6 +3311,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3171,6 +3327,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3207,6 +3364,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3222,6 +3380,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3237,6 +3396,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3252,6 +3412,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3267,6 +3428,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 0, "storageOption": "External", "singleton": 0, @@ -3282,6 +3444,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -3297,6 +3460,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3333,6 +3497,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "HourFormat", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3348,6 +3513,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "CalendarType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3363,6 +3529,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3378,6 +3545,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3393,6 +3561,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3408,6 +3577,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 0, "storageOption": "External", "singleton": 0, @@ -3423,6 +3593,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -3438,6 +3609,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3474,6 +3646,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "TempUnit", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -3489,6 +3662,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3504,6 +3678,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3519,6 +3694,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3545,6 +3721,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3571,6 +3748,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3586,6 +3764,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3601,6 +3780,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3616,6 +3796,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3631,6 +3812,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3657,6 +3839,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3683,6 +3866,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3698,6 +3882,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3713,6 +3898,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3728,7 +3914,8 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3743,7 +3930,8 @@ "code": 4, "mfgCode": null, "side": "server", - "included": 0, + "type": "int16u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3758,7 +3946,8 @@ "code": 5, "mfgCode": null, "side": "server", - "included": 0, + "type": "enum8", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3773,7 +3962,8 @@ "code": 6, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3788,7 +3978,8 @@ "code": 7, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3803,7 +3994,8 @@ "code": 8, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3818,7 +4010,8 @@ "code": 9, "mfgCode": null, "side": "server", - "included": 0, + "type": "boolean", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3833,7 +4026,8 @@ "code": 10, "mfgCode": null, "side": "server", - "included": 0, + "type": "array", + "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -3848,6 +4042,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3863,6 +4058,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3878,6 +4074,7 @@ "code": 13, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3893,6 +4090,7 @@ "code": 14, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -3908,7 +4106,8 @@ "code": 15, "mfgCode": null, "side": "server", - "included": 0, + "type": "boolean", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3923,7 +4122,8 @@ "code": 16, "mfgCode": null, "side": "server", - "included": 0, + "type": "enum8", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3938,7 +4138,8 @@ "code": 17, "mfgCode": null, "side": "server", - "included": 0, + "type": "boolean", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3953,6 +4154,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3968,7 +4170,8 @@ "code": 19, "mfgCode": null, "side": "server", - "included": 0, + "type": "char_string", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3983,7 +4186,8 @@ "code": 20, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -3998,7 +4202,8 @@ "code": 21, "mfgCode": null, "side": "server", - "included": 0, + "type": "char_string", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4013,7 +4218,8 @@ "code": 22, "mfgCode": null, "side": "server", - "included": 0, + "type": "char_string", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4028,7 +4234,8 @@ "code": 23, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4043,7 +4250,8 @@ "code": 24, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4058,7 +4266,8 @@ "code": 25, "mfgCode": null, "side": "server", - "included": 0, + "type": "int8u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4073,6 +4282,7 @@ "code": 26, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4088,7 +4298,8 @@ "code": 27, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4103,7 +4314,8 @@ "code": 28, "mfgCode": null, "side": "server", - "included": 0, + "type": "boolean", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4118,7 +4330,8 @@ "code": 29, "mfgCode": null, "side": "server", - "included": 0, + "type": "int32u", + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -4133,7 +4346,8 @@ "code": 30, "mfgCode": null, "side": "server", - "included": 0, + "type": "array", + "included": 1, "storageOption": "External", "singleton": 0, "bounded": 0, @@ -4148,6 +4362,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4163,6 +4378,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4178,6 +4394,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4193,6 +4410,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4208,6 +4426,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4259,6 +4478,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4274,6 +4494,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4325,6 +4546,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4340,6 +4562,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "BasicCommissioningInfo", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4355,6 +4578,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "RegulatoryLocationType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4370,6 +4594,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "RegulatoryLocationType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4385,6 +4610,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "External", "singleton": 0, @@ -4400,6 +4626,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4415,6 +4642,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4430,6 +4658,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4445,6 +4674,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -4460,6 +4690,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4535,6 +4766,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4550,6 +4782,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4601,6 +4834,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4616,6 +4850,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4631,6 +4866,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4646,6 +4882,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4661,6 +4898,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4676,6 +4914,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "NetworkCommissioningStatus", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4691,6 +4930,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4706,6 +4946,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int32s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4721,6 +4962,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4736,6 +4978,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4751,6 +4994,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 0, "storageOption": "External", "singleton": 0, @@ -4766,6 +5010,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4781,6 +5026,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4835,6 +5081,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4850,6 +5097,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4865,6 +5113,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4880,6 +5129,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -4895,6 +5145,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -4921,6 +5172,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -4947,6 +5199,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -4962,6 +5215,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -4977,6 +5231,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -4992,6 +5247,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -5007,6 +5263,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "External", "singleton": 0, @@ -5022,6 +5279,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5037,6 +5295,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5052,6 +5311,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5067,6 +5327,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5082,6 +5343,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5097,6 +5359,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5112,6 +5375,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -5127,6 +5391,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5162,6 +5427,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5177,6 +5443,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5203,6 +5470,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5218,6 +5486,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -5233,6 +5502,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -5248,6 +5518,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -5263,6 +5534,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5278,6 +5550,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5293,6 +5566,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5308,6 +5582,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5323,6 +5598,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5358,6 +5634,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5373,6 +5650,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5399,6 +5677,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5414,6 +5693,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5429,6 +5709,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5444,6 +5725,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5459,6 +5741,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5474,6 +5757,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5489,6 +5773,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5504,6 +5789,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5519,6 +5805,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -5534,6 +5821,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5549,6 +5837,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5564,6 +5853,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5579,6 +5869,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5594,6 +5885,7 @@ "code": 13, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5609,6 +5901,7 @@ "code": 14, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5624,6 +5917,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5639,6 +5933,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5654,6 +5949,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5669,6 +5965,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5684,6 +5981,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5699,6 +5997,7 @@ "code": 20, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5714,6 +6013,7 @@ "code": 21, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5729,6 +6029,7 @@ "code": 22, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5744,6 +6045,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5759,6 +6061,7 @@ "code": 24, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5774,6 +6077,7 @@ "code": 25, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5789,6 +6093,7 @@ "code": 26, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5804,6 +6109,7 @@ "code": 27, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5819,6 +6125,7 @@ "code": 28, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5834,6 +6141,7 @@ "code": 29, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5849,6 +6157,7 @@ "code": 30, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5864,6 +6173,7 @@ "code": 31, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5879,6 +6189,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5894,6 +6205,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5909,6 +6221,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5924,6 +6237,7 @@ "code": 35, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5939,6 +6253,7 @@ "code": 36, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5954,6 +6269,7 @@ "code": 37, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5969,6 +6285,7 @@ "code": 38, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5984,6 +6301,7 @@ "code": 39, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -5999,6 +6317,7 @@ "code": 40, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6014,6 +6333,7 @@ "code": 41, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6029,6 +6349,7 @@ "code": 42, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6044,6 +6365,7 @@ "code": 43, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6059,6 +6381,7 @@ "code": 44, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6074,6 +6397,7 @@ "code": 45, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6089,6 +6413,7 @@ "code": 46, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6104,6 +6429,7 @@ "code": 47, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6119,6 +6445,7 @@ "code": 48, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6134,6 +6461,7 @@ "code": 49, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6149,6 +6477,7 @@ "code": 50, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6164,6 +6493,7 @@ "code": 51, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6179,6 +6509,7 @@ "code": 52, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6194,6 +6525,7 @@ "code": 53, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6209,6 +6541,7 @@ "code": 54, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6224,6 +6557,7 @@ "code": 55, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6239,6 +6573,7 @@ "code": 56, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6254,6 +6589,7 @@ "code": 57, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6269,6 +6605,7 @@ "code": 58, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6284,6 +6621,7 @@ "code": 59, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6299,6 +6637,7 @@ "code": 60, "mfgCode": null, "side": "server", + "type": "octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6314,6 +6653,7 @@ "code": 61, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6329,6 +6669,7 @@ "code": 62, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6344,6 +6685,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6359,6 +6701,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6374,6 +6717,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6389,6 +6733,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6404,6 +6749,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6439,6 +6785,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -6454,6 +6801,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6480,6 +6828,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6495,6 +6844,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "SecurityType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6510,6 +6860,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "WiFiVersionType", "included": 1, "storageOption": "External", "singleton": 0, @@ -6525,6 +6876,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6540,6 +6892,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int8s", "included": 1, "storageOption": "External", "singleton": 0, @@ -6555,6 +6908,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6570,6 +6924,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6585,6 +6940,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6600,6 +6956,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6615,6 +6972,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6630,6 +6988,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6645,6 +7004,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6660,6 +7020,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6675,6 +7036,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6690,6 +7052,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6705,6 +7068,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6720,6 +7084,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6735,6 +7100,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6770,6 +7136,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6785,6 +7152,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6811,6 +7179,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "PHYRateType", "included": 1, "storageOption": "External", "singleton": 0, @@ -6826,6 +7195,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "External", "singleton": 0, @@ -6841,6 +7211,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6856,6 +7227,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6871,6 +7243,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6886,6 +7259,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6901,6 +7275,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6916,6 +7291,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "External", "singleton": 0, @@ -6931,6 +7307,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "External", "singleton": 0, @@ -6946,6 +7323,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6961,6 +7339,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6976,6 +7355,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -6991,6 +7371,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7006,6 +7387,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7032,6 +7414,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7058,6 +7441,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7073,6 +7457,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "vendor_id", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7088,6 +7473,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7103,6 +7489,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -7118,6 +7505,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7133,6 +7521,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7148,6 +7537,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7163,6 +7553,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7178,6 +7569,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7193,6 +7585,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7208,6 +7601,7 @@ "code": 13, "mfgCode": null, "side": "server", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7223,6 +7617,7 @@ "code": 14, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7238,6 +7633,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7253,6 +7649,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7268,6 +7665,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7283,6 +7681,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7298,6 +7697,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7313,6 +7713,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7328,6 +7729,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7354,6 +7756,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7380,6 +7783,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7395,6 +7799,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7410,6 +7815,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7425,6 +7831,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7440,6 +7847,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7455,6 +7863,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7470,6 +7879,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7485,6 +7895,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7536,6 +7947,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7562,6 +7974,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "External", "singleton": 0, @@ -7577,6 +7990,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "fabric_idx", "included": 1, "storageOption": "External", "singleton": 0, @@ -7592,6 +8006,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -7607,6 +8022,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7622,6 +8038,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7637,6 +8054,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7652,6 +8070,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -7667,6 +8086,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7766,6 +8186,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7825,6 +8246,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7840,6 +8262,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7855,6 +8278,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7870,6 +8294,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7885,6 +8310,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7900,6 +8326,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "fabric_idx", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -7915,6 +8342,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7930,6 +8358,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7945,6 +8374,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -7960,6 +8390,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -7975,6 +8406,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8034,6 +8466,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8077,6 +8510,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8092,6 +8526,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8107,6 +8542,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -8122,6 +8558,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "External", "singleton": 0, @@ -8137,6 +8574,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8152,6 +8590,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8167,6 +8606,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8182,6 +8622,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -8197,6 +8638,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8223,6 +8665,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8249,6 +8692,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8264,6 +8708,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8279,6 +8724,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8294,6 +8740,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8309,6 +8756,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -8324,6 +8772,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8360,6 +8809,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8375,6 +8825,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8390,6 +8841,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8405,6 +8857,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 0, "storageOption": "External", "singleton": 0, @@ -8420,6 +8873,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -8435,6 +8889,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8461,6 +8916,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8487,6 +8943,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8502,6 +8959,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8517,6 +8975,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8532,6 +8991,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8547,6 +9007,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -8562,6 +9023,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8597,6 +9059,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -8612,6 +9075,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8638,6 +9102,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8653,6 +9118,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum16", "included": 1, "storageOption": "External", "singleton": 0, @@ -8668,6 +9134,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8683,6 +9150,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8698,6 +9166,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8713,6 +9182,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8728,6 +9198,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8743,6 +9214,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8758,6 +9230,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -8773,6 +9246,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8788,6 +9262,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -8959,6 +9434,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -8974,6 +9450,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9089,6 +9566,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "DlLockState", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9104,6 +9582,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "DlLockType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9119,6 +9598,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9134,6 +9614,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "DlDoorState", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9149,6 +9630,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int32u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9164,6 +9646,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int32u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9179,6 +9662,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9194,6 +9678,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9209,6 +9694,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9224,6 +9710,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9239,6 +9726,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9254,6 +9742,7 @@ "code": 20, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9269,6 +9758,7 @@ "code": 21, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9284,6 +9774,7 @@ "code": 22, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9299,6 +9790,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9314,6 +9806,7 @@ "code": 24, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9329,6 +9822,7 @@ "code": 25, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9344,6 +9838,7 @@ "code": 26, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9359,6 +9854,7 @@ "code": 27, "mfgCode": null, "side": "server", + "type": "DlCredentialRuleMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9374,6 +9870,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "boolean", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9389,6 +9886,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9404,6 +9902,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "int8u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9419,6 +9918,7 @@ "code": 35, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9434,6 +9934,7 @@ "code": 36, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9449,6 +9950,7 @@ "code": 37, "mfgCode": null, "side": "server", + "type": "DlOperatingMode", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9464,6 +9966,7 @@ "code": 38, "mfgCode": null, "side": "server", + "type": "DlSupportedOperatingModes", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9479,6 +9982,7 @@ "code": 39, "mfgCode": null, "side": "server", + "type": "DlDefaultConfigurationRegister", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9494,6 +9998,7 @@ "code": 40, "mfgCode": null, "side": "server", + "type": "boolean", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9509,6 +10014,7 @@ "code": 41, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9524,6 +10030,7 @@ "code": 42, "mfgCode": null, "side": "server", + "type": "boolean", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9539,6 +10046,7 @@ "code": 43, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9554,6 +10062,7 @@ "code": 44, "mfgCode": null, "side": "server", + "type": "DlLocalProgrammingFeatures", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9569,6 +10078,7 @@ "code": 48, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9584,6 +10094,7 @@ "code": 49, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9599,6 +10110,7 @@ "code": 50, "mfgCode": null, "side": "server", + "type": "boolean", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9614,6 +10126,7 @@ "code": 51, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9629,6 +10142,7 @@ "code": 53, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9644,6 +10158,7 @@ "code": 64, "mfgCode": null, "side": "server", + "type": "DlAlarmMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9659,6 +10174,7 @@ "code": 65, "mfgCode": null, "side": "server", + "type": "DlKeypadOperationEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9674,6 +10190,7 @@ "code": 66, "mfgCode": null, "side": "server", + "type": "DlRemoteOperationEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9689,6 +10206,7 @@ "code": 67, "mfgCode": null, "side": "server", + "type": "DlManualOperationEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9704,6 +10222,7 @@ "code": 68, "mfgCode": null, "side": "server", + "type": "DlRFIDOperationEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9719,6 +10238,7 @@ "code": 69, "mfgCode": null, "side": "server", + "type": "DlKeypadOperationEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9734,6 +10254,7 @@ "code": 70, "mfgCode": null, "side": "server", + "type": "DlRemoteProgrammingEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9749,6 +10270,7 @@ "code": 71, "mfgCode": null, "side": "server", + "type": "DlRFIDProgrammingEventMask", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9764,6 +10286,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -9779,6 +10302,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -9794,6 +10318,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -9809,6 +10334,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9824,6 +10350,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9907,6 +10434,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9933,6 +10461,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "Type", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -9948,6 +10477,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9963,6 +10493,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -9978,6 +10509,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -9993,6 +10525,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10008,6 +10541,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10023,6 +10557,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10038,6 +10573,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "ConfigStatus", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10053,6 +10589,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "Percent", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10068,6 +10605,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "Percent", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10083,6 +10621,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10098,6 +10637,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "Percent100ths", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10113,6 +10653,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "Percent100ths", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10128,6 +10669,7 @@ "code": 13, "mfgCode": null, "side": "server", + "type": "EndProductType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10143,6 +10685,7 @@ "code": 14, "mfgCode": null, "side": "server", + "type": "Percent100ths", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10158,6 +10701,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "Percent100ths", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10173,6 +10717,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10188,6 +10733,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10203,6 +10749,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10218,6 +10765,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10233,6 +10781,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "Mode", "included": 1, "storageOption": "NVM", "singleton": 0, @@ -10248,6 +10797,7 @@ "code": 26, "mfgCode": null, "side": "server", + "type": "bitmap16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10263,6 +10813,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -10278,6 +10829,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -10293,6 +10845,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -10308,6 +10861,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10323,6 +10877,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10366,6 +10921,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10392,6 +10948,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10407,6 +10964,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "bitmap16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10422,6 +10980,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10437,6 +10996,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10452,6 +11012,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10467,6 +11028,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10482,6 +11044,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10497,6 +11060,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10512,6 +11076,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10527,6 +11092,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10542,6 +11108,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -10557,6 +11124,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -10572,6 +11140,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -10587,6 +11156,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -10602,6 +11172,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10628,6 +11199,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10643,6 +11215,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10669,6 +11242,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10684,6 +11258,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10699,6 +11274,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10714,6 +11290,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10729,6 +11306,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10744,6 +11322,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10759,6 +11338,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10774,6 +11354,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10789,6 +11370,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10804,6 +11386,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10819,6 +11402,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10834,6 +11418,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10849,6 +11434,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10864,6 +11450,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "bitmap16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10879,6 +11466,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "PumpOperationMode", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10894,6 +11482,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "PumpControlMode", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10909,6 +11498,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10924,6 +11514,7 @@ "code": 20, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10939,6 +11530,7 @@ "code": 21, "mfgCode": null, "side": "server", + "type": "int24u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10954,6 +11546,7 @@ "code": 22, "mfgCode": null, "side": "server", + "type": "int24u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10969,6 +11562,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10984,6 +11578,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "PumpOperationMode", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -10999,6 +11594,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "PumpControlMode", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11014,6 +11610,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "bitmap16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11029,6 +11626,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11044,6 +11642,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11059,6 +11658,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11074,6 +11674,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11089,6 +11690,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11156,6 +11758,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11199,6 +11802,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11214,6 +11818,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11229,6 +11834,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11244,6 +11850,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11259,6 +11866,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11274,6 +11882,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int8u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11289,6 +11898,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "int8u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11304,6 +11914,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11319,6 +11930,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11334,6 +11946,7 @@ "code": 21, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11349,6 +11962,7 @@ "code": 22, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11364,6 +11978,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11379,6 +11994,7 @@ "code": 24, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11394,6 +12010,7 @@ "code": 25, "mfgCode": null, "side": "server", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11409,6 +12026,7 @@ "code": 27, "mfgCode": null, "side": "server", + "type": "ThermostatControlSequence", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11424,6 +12042,7 @@ "code": 28, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11439,6 +12058,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11454,6 +12074,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11469,6 +12090,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11484,6 +12106,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11499,6 +12122,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11514,6 +12138,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11550,6 +12175,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "FanModeType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11565,6 +12191,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "FanModeSequenceType", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11580,6 +12207,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11595,6 +12223,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11610,6 +12239,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11625,6 +12255,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11640,6 +12271,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11655,6 +12287,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11670,6 +12303,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11685,6 +12319,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11700,6 +12335,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11715,6 +12351,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11730,6 +12367,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11745,6 +12383,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11760,6 +12399,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11775,6 +12415,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11801,6 +12442,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11827,6 +12469,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11842,6 +12485,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11857,6 +12501,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -11872,6 +12517,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11887,6 +12533,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11902,6 +12549,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -11917,6 +12565,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -11932,6 +12581,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12111,6 +12761,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12137,6 +12788,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12152,6 +12804,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12167,6 +12820,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12182,6 +12836,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12197,6 +12852,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12212,6 +12868,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12227,6 +12884,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12242,6 +12900,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12257,6 +12916,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12272,6 +12932,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12287,6 +12948,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12302,6 +12964,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12317,6 +12980,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12332,6 +12996,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12347,6 +13012,7 @@ "code": 21, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12362,6 +13028,7 @@ "code": 22, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12377,6 +13044,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12392,6 +13060,7 @@ "code": 25, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12407,6 +13076,7 @@ "code": 26, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12422,6 +13092,7 @@ "code": 27, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12437,6 +13108,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12452,6 +13124,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12467,6 +13140,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12482,6 +13156,7 @@ "code": 36, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12497,6 +13172,7 @@ "code": 37, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12512,6 +13188,7 @@ "code": 38, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12527,6 +13204,7 @@ "code": 40, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12542,6 +13220,7 @@ "code": 41, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12557,6 +13236,7 @@ "code": 42, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12572,6 +13252,7 @@ "code": 48, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12587,6 +13268,7 @@ "code": 49, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12602,6 +13284,7 @@ "code": 50, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12617,6 +13300,7 @@ "code": 51, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12632,6 +13316,7 @@ "code": 52, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12647,6 +13332,7 @@ "code": 54, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12662,6 +13348,7 @@ "code": 55, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12677,6 +13364,7 @@ "code": 56, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12692,6 +13380,7 @@ "code": 58, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12707,6 +13396,7 @@ "code": 59, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12722,6 +13412,7 @@ "code": 60, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12737,6 +13428,7 @@ "code": 16384, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12752,6 +13444,7 @@ "code": 16385, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12767,6 +13460,7 @@ "code": 16386, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12782,6 +13476,7 @@ "code": 16387, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12797,6 +13492,7 @@ "code": 16388, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12812,6 +13508,7 @@ "code": 16389, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12827,6 +13524,7 @@ "code": 16390, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12842,6 +13540,7 @@ "code": 16394, "mfgCode": null, "side": "server", + "type": "bitmap16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12857,6 +13556,7 @@ "code": 16395, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12872,6 +13572,7 @@ "code": 16396, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12887,6 +13588,7 @@ "code": 16397, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12902,6 +13604,7 @@ "code": 16400, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -12917,6 +13620,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -12932,6 +13636,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -12947,6 +13652,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -12962,6 +13668,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -12977,6 +13684,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13003,6 +13711,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13029,6 +13738,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13044,6 +13754,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13059,6 +13770,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13074,6 +13786,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13089,6 +13802,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13104,6 +13818,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13119,6 +13834,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13134,6 +13850,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13149,6 +13866,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13175,6 +13893,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13201,6 +13920,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13216,6 +13936,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13231,6 +13952,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13246,6 +13968,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13261,6 +13984,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13276,6 +14000,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13302,6 +14027,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13328,6 +14054,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13343,6 +14070,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13358,6 +14086,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13373,6 +14102,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13388,6 +14118,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int16s", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13403,6 +14134,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13418,6 +14150,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13433,6 +14166,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13459,6 +14193,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13485,6 +14220,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13500,6 +14236,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13515,6 +14252,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13530,6 +14268,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13545,6 +14284,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13560,6 +14300,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13575,6 +14316,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13590,6 +14332,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13616,6 +14359,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13642,6 +14386,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13657,6 +14402,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13672,6 +14418,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13687,6 +14434,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13702,6 +14450,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13717,6 +14466,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13732,6 +14482,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -13747,6 +14498,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13762,6 +14514,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13788,6 +14541,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13814,6 +14568,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13829,6 +14584,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13844,6 +14600,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "bitmap8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13859,6 +14616,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13874,6 +14632,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13889,6 +14648,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int8u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13904,6 +14664,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13919,6 +14680,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13934,6 +14696,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "int8u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13949,6 +14712,7 @@ "code": 48, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13964,6 +14728,7 @@ "code": 49, "mfgCode": null, "side": "server", + "type": "int16u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13979,6 +14744,7 @@ "code": 50, "mfgCode": null, "side": "server", + "type": "int8u", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -13994,6 +14760,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14009,6 +14776,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14024,6 +14792,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14039,6 +14808,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14054,6 +14824,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14089,6 +14860,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14132,6 +14904,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14147,6 +14920,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "enum16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14162,6 +14936,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "bitmap16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14177,6 +14952,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "node_id", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14192,6 +14968,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14207,6 +14984,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14233,6 +15011,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14248,6 +15027,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14274,6 +15054,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14289,6 +15070,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14304,6 +15086,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14319,6 +15102,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14334,6 +15118,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14349,6 +15134,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14400,6 +15186,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14435,6 +15222,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14450,6 +15238,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "LineupInfo", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14465,6 +15254,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "ChannelInfo", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14480,6 +15270,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14495,6 +15286,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14510,6 +15302,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14525,6 +15318,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14540,6 +15334,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14575,6 +15370,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14590,6 +15386,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14625,6 +15422,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14640,6 +15438,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14655,6 +15454,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14670,6 +15470,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14685,6 +15486,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -14700,6 +15502,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14715,6 +15518,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14830,6 +15634,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -14845,6 +15650,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14880,6 +15686,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "PlaybackStateEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14895,6 +15702,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "epoch_us", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14910,6 +15718,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14925,6 +15734,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "PlaybackPosition", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14940,6 +15750,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "single", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14955,6 +15766,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14970,6 +15782,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -14985,6 +15798,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15000,6 +15814,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15015,6 +15830,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15030,6 +15846,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15045,6 +15862,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15104,6 +15922,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15119,6 +15938,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15145,6 +15965,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15160,6 +15981,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15175,6 +15997,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15190,6 +16013,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15205,6 +16029,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15220,6 +16045,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15235,6 +16061,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15270,6 +16097,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15285,6 +16113,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15311,6 +16140,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15326,6 +16156,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15341,6 +16172,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15356,6 +16188,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15371,6 +16204,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15406,6 +16240,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15421,6 +16256,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15456,6 +16292,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15471,6 +16308,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15486,6 +16324,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15501,6 +16340,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15516,6 +16356,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15559,6 +16400,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15574,6 +16416,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15609,6 +16452,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15624,6 +16468,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15639,6 +16484,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15654,6 +16500,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15669,6 +16516,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15684,6 +16532,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15699,6 +16548,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15742,6 +16592,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15757,6 +16608,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15783,6 +16635,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15798,6 +16651,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15813,6 +16667,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15828,6 +16683,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15843,6 +16699,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15858,6 +16715,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15873,6 +16731,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15924,6 +16783,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -15939,6 +16799,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15974,6 +16835,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -15989,6 +16851,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "ApplicationEP", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16004,6 +16867,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16019,6 +16883,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16034,6 +16899,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16049,6 +16915,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -16064,6 +16931,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16090,6 +16958,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -16105,6 +16974,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16131,6 +17001,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16146,6 +17017,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16161,6 +17033,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16176,6 +17049,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16191,6 +17065,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "ApplicationBasicApplication", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16206,6 +17081,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "ApplicationStatusEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16221,6 +17097,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16236,6 +17113,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16251,6 +17129,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16266,6 +17145,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16281,6 +17161,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16296,6 +17177,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -16311,6 +17193,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16362,6 +17245,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -16377,6 +17261,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16412,6 +17297,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16427,6 +17313,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16442,6 +17329,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -16457,6 +17345,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -16472,6 +17361,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16643,6 +17533,7 @@ "code": 65532, "mfgCode": null, "side": "client", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -16658,6 +17549,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16749,6 +17641,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16764,6 +17657,7 @@ "code": 1, "mfgCode": null, "side": "server", + "type": "Bitmap8MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16779,6 +17673,7 @@ "code": 2, "mfgCode": null, "side": "server", + "type": "Bitmap16MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16794,6 +17689,7 @@ "code": 3, "mfgCode": null, "side": "server", + "type": "Bitmap32MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16809,6 +17705,7 @@ "code": 4, "mfgCode": null, "side": "server", + "type": "Bitmap64MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16824,6 +17721,7 @@ "code": 5, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16839,6 +17737,7 @@ "code": 6, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16854,6 +17753,7 @@ "code": 7, "mfgCode": null, "side": "server", + "type": "int24u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16869,6 +17769,7 @@ "code": 8, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16884,6 +17785,7 @@ "code": 9, "mfgCode": null, "side": "server", + "type": "int40u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16899,6 +17801,7 @@ "code": 10, "mfgCode": null, "side": "server", + "type": "int48u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16914,6 +17817,7 @@ "code": 11, "mfgCode": null, "side": "server", + "type": "int56u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16929,6 +17833,7 @@ "code": 12, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16944,6 +17849,7 @@ "code": 13, "mfgCode": null, "side": "server", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16959,6 +17865,7 @@ "code": 14, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16974,6 +17881,7 @@ "code": 15, "mfgCode": null, "side": "server", + "type": "int24s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -16989,6 +17897,7 @@ "code": 16, "mfgCode": null, "side": "server", + "type": "int32s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17004,6 +17913,7 @@ "code": 17, "mfgCode": null, "side": "server", + "type": "int40s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17019,6 +17929,7 @@ "code": 18, "mfgCode": null, "side": "server", + "type": "int48s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17034,6 +17945,7 @@ "code": 19, "mfgCode": null, "side": "server", + "type": "int56s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17049,6 +17961,7 @@ "code": 20, "mfgCode": null, "side": "server", + "type": "int64s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17064,6 +17977,7 @@ "code": 21, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17079,6 +17993,7 @@ "code": 22, "mfgCode": null, "side": "server", + "type": "enum16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17094,6 +18009,7 @@ "code": 23, "mfgCode": null, "side": "server", + "type": "single", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17109,6 +18025,7 @@ "code": 24, "mfgCode": null, "side": "server", + "type": "double", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17124,6 +18041,7 @@ "code": 25, "mfgCode": null, "side": "server", + "type": "octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17139,6 +18057,7 @@ "code": 26, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17154,6 +18073,7 @@ "code": 27, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17169,6 +18089,7 @@ "code": 28, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17184,6 +18105,7 @@ "code": 29, "mfgCode": null, "side": "server", + "type": "long_octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17199,6 +18121,7 @@ "code": 30, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17214,6 +18137,7 @@ "code": 31, "mfgCode": null, "side": "server", + "type": "long_char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17229,6 +18153,7 @@ "code": 32, "mfgCode": null, "side": "server", + "type": "epoch_us", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17244,6 +18169,7 @@ "code": 33, "mfgCode": null, "side": "server", + "type": "epoch_s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17259,6 +18185,7 @@ "code": 34, "mfgCode": null, "side": "server", + "type": "vendor_id", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17274,6 +18201,7 @@ "code": 35, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17289,6 +18217,7 @@ "code": 36, "mfgCode": null, "side": "server", + "type": "SimpleEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17304,6 +18233,7 @@ "code": 37, "mfgCode": null, "side": "server", + "type": "SimpleStruct", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17319,6 +18249,7 @@ "code": 38, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17334,6 +18265,7 @@ "code": 39, "mfgCode": null, "side": "server", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17349,6 +18281,7 @@ "code": 40, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17364,6 +18297,7 @@ "code": 41, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17379,6 +18313,7 @@ "code": 42, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17394,6 +18329,7 @@ "code": 43, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17409,6 +18345,7 @@ "code": 48, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17424,6 +18361,7 @@ "code": 49, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17439,6 +18377,7 @@ "code": 50, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17454,6 +18393,7 @@ "code": 255, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17469,6 +18409,7 @@ "code": 16384, "mfgCode": null, "side": "server", + "type": "boolean", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17484,6 +18425,7 @@ "code": 16385, "mfgCode": null, "side": "server", + "type": "Bitmap8MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17499,6 +18441,7 @@ "code": 16386, "mfgCode": null, "side": "server", + "type": "Bitmap16MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17514,6 +18457,7 @@ "code": 16387, "mfgCode": null, "side": "server", + "type": "Bitmap32MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17529,6 +18473,7 @@ "code": 16388, "mfgCode": null, "side": "server", + "type": "Bitmap64MaskMap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17544,6 +18489,7 @@ "code": 16389, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17559,6 +18505,7 @@ "code": 16390, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17574,6 +18521,7 @@ "code": 16391, "mfgCode": null, "side": "server", + "type": "int24u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17589,6 +18537,7 @@ "code": 16392, "mfgCode": null, "side": "server", + "type": "int32u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17604,6 +18553,7 @@ "code": 16393, "mfgCode": null, "side": "server", + "type": "int40u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17619,6 +18569,7 @@ "code": 16394, "mfgCode": null, "side": "server", + "type": "int48u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17634,6 +18585,7 @@ "code": 16395, "mfgCode": null, "side": "server", + "type": "int56u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17649,6 +18601,7 @@ "code": 16396, "mfgCode": null, "side": "server", + "type": "int64u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17664,6 +18617,7 @@ "code": 16397, "mfgCode": null, "side": "server", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17679,6 +18633,7 @@ "code": 16398, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17694,6 +18649,7 @@ "code": 16399, "mfgCode": null, "side": "server", + "type": "int24s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17709,6 +18665,7 @@ "code": 16400, "mfgCode": null, "side": "server", + "type": "int32s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17724,6 +18681,7 @@ "code": 16401, "mfgCode": null, "side": "server", + "type": "int40s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17739,6 +18697,7 @@ "code": 16402, "mfgCode": null, "side": "server", + "type": "int48s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17754,6 +18713,7 @@ "code": 16403, "mfgCode": null, "side": "server", + "type": "int56s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17769,6 +18729,7 @@ "code": 16404, "mfgCode": null, "side": "server", + "type": "int64s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17784,6 +18745,7 @@ "code": 16405, "mfgCode": null, "side": "server", + "type": "enum8", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17799,6 +18761,7 @@ "code": 16406, "mfgCode": null, "side": "server", + "type": "enum16", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17814,6 +18777,7 @@ "code": 16407, "mfgCode": null, "side": "server", + "type": "single", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17829,6 +18793,7 @@ "code": 16408, "mfgCode": null, "side": "server", + "type": "double", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17844,6 +18809,7 @@ "code": 16409, "mfgCode": null, "side": "server", + "type": "octet_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17859,6 +18825,7 @@ "code": 16414, "mfgCode": null, "side": "server", + "type": "char_string", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17874,6 +18841,7 @@ "code": 16420, "mfgCode": null, "side": "server", + "type": "SimpleEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17889,6 +18857,7 @@ "code": 16421, "mfgCode": null, "side": "server", + "type": "SimpleStruct", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17904,6 +18873,7 @@ "code": 16422, "mfgCode": null, "side": "server", + "type": "int8u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17919,6 +18889,7 @@ "code": 16423, "mfgCode": null, "side": "server", + "type": "int8s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17934,6 +18905,7 @@ "code": 16424, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17949,6 +18921,7 @@ "code": 16425, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -17964,6 +18937,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17979,6 +18953,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -17994,6 +18969,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -18009,6 +18985,7 @@ "code": 65532, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -18024,6 +19001,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18050,6 +19028,7 @@ "code": 65533, "mfgCode": null, "side": "client", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18076,6 +19055,7 @@ "code": 0, "mfgCode": null, "side": "server", + "type": "bitmap32", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18091,6 +19071,7 @@ "code": 772, "mfgCode": null, "side": "server", + "type": "int32s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18106,6 +19087,7 @@ "code": 1285, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18121,6 +19103,7 @@ "code": 1286, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18136,6 +19119,7 @@ "code": 1287, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18151,6 +19135,7 @@ "code": 1288, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18166,6 +19151,7 @@ "code": 1289, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18181,6 +19167,7 @@ "code": 1290, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18196,6 +19183,7 @@ "code": 1291, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18211,6 +19199,7 @@ "code": 1292, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18226,6 +19215,7 @@ "code": 1293, "mfgCode": null, "side": "server", + "type": "int16s", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18241,6 +19231,7 @@ "code": 65528, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -18256,6 +19247,7 @@ "code": 65529, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -18271,6 +19263,7 @@ "code": 65531, "mfgCode": null, "side": "server", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -18286,6 +19279,7 @@ "code": 65533, "mfgCode": null, "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -18311,5 +19305,6 @@ "endpointVersion": 1, "deviceIdentifier": 22 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index e04a1abcde47c7..0baae5d9217045 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -9911,6 +9911,135 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); return value; } + case Attributes::WiredAssessedInputVoltage::Id: { + using TypeInfo = Attributes::WiredAssessedInputVoltage::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::WiredAssessedInputFrequency::Id: { + using TypeInfo = Attributes::WiredAssessedInputFrequency::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; + } + case Attributes::WiredCurrentType::Id: { + using TypeInfo = Attributes::WiredCurrentType::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; + } + case Attributes::WiredAssessedCurrent::Id: { + using TypeInfo = Attributes::WiredAssessedCurrent::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::WiredNominalVoltage::Id: { + using TypeInfo = Attributes::WiredNominalVoltage::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::WiredMaximumCurrent::Id: { + using TypeInfo = Attributes::WiredMaximumCurrent::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::WiredPresent::Id: { + using TypeInfo = Attributes::WiredPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::ActiveWiredFaults::Id: { + using TypeInfo = Attributes::ActiveWiredFaults::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/Integer"; + std::string newElement_0CtorSignature = "(I)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::BatteryVoltage::Id: { using TypeInfo = Attributes::BatteryVoltage::TypeInfo; TypeInfo::DecodableType cppValue; @@ -9971,6 +10100,51 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::BatteryReplacementNeeded::Id: { + using TypeInfo = Attributes::BatteryReplacementNeeded::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::BatteryReplaceability::Id: { + using TypeInfo = Attributes::BatteryReplaceability::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; + } + case Attributes::BatteryPresent::Id: { + using TypeInfo = Attributes::BatteryPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } case Attributes::ActiveBatteryFaults::Id: { using TypeInfo = Attributes::ActiveBatteryFaults::TypeInfo; TypeInfo::DecodableType cppValue; @@ -9995,6 +10169,102 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } + case Attributes::BatteryReplacementDescription::Id: { + using TypeInfo = Attributes::BatteryReplacementDescription::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::BatteryCommonDesignation::Id: { + using TypeInfo = Attributes::BatteryCommonDesignation::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::BatteryANSIDesignation::Id: { + using TypeInfo = Attributes::BatteryANSIDesignation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::BatteryIECDesignation::Id: { + using TypeInfo = Attributes::BatteryIECDesignation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + value = env->NewStringUTF(std::string(cppValue.data(), cppValue.size()).c_str()); + return value; + } + case Attributes::BatteryApprovedChemistry::Id: { + using TypeInfo = Attributes::BatteryApprovedChemistry::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::BatteryCapacity::Id: { + using TypeInfo = Attributes::BatteryCapacity::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::BatteryQuantity::Id: { + using TypeInfo = Attributes::BatteryQuantity::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; + } case Attributes::BatteryChargeState::Id: { using TypeInfo = Attributes::BatteryChargeState::TypeInfo; TypeInfo::DecodableType cppValue; @@ -10010,6 +10280,75 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + case Attributes::BatteryTimeToFullCharge::Id: { + using TypeInfo = Attributes::BatteryTimeToFullCharge::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::BatteryFunctionalWhileCharging::Id: { + using TypeInfo = Attributes::BatteryFunctionalWhileCharging::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::BatteryChargingCurrent::Id: { + using TypeInfo = Attributes::BatteryChargingCurrent::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::ActiveBatteryChargeFaults::Id: { + using TypeInfo = Attributes::ActiveBatteryChargeFaults::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/Integer"; + std::string newElement_0CtorSignature = "(I)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::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index a686ea22162572..18c695e87c4b93 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -1031,6 +1031,22 @@ typedef void (*CHIPPowerSourceClusterOrderAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::Order::TypeInfo::DecodableArgType); typedef void (*CHIPPowerSourceClusterDescriptionAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::Description::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredAssessedInputVoltageAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredAssessedInputFrequencyAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredCurrentTypeAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredCurrentType::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredAssessedCurrentAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredAssessedCurrent::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredNominalVoltageAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredNominalVoltage::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredMaximumCurrentAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredMaximumCurrent::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterWiredPresentAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::WiredPresent::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterActiveWiredFaultsAttributeCallbackType)( + void *, const chip::app::Clusters::PowerSource::Attributes::ActiveWiredFaults::TypeInfo::DecodableType &); typedef void (*CHIPPowerSourceClusterBatteryVoltageAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::BatteryVoltage::TypeInfo::DecodableArgType); typedef void (*CHIPPowerSourceClusterBatteryPercentRemainingAttributeCallbackType)( @@ -1039,10 +1055,38 @@ typedef void (*CHIPPowerSourceClusterBatteryTimeRemainingAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::BatteryTimeRemaining::TypeInfo::DecodableArgType); typedef void (*CHIPPowerSourceClusterBatteryChargeLevelAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::BatteryChargeLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryReplacementNeededAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryReplacementNeeded::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryReplaceabilityAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryReplaceability::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryPresentAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryPresent::TypeInfo::DecodableArgType); typedef void (*CHIPPowerSourceClusterActiveBatteryFaultsAttributeCallbackType)( void *, const chip::app::Clusters::PowerSource::Attributes::ActiveBatteryFaults::TypeInfo::DecodableType &); +typedef void (*CHIPPowerSourceClusterBatteryReplacementDescriptionAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryReplacementDescription::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryCommonDesignationAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryCommonDesignation::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryANSIDesignationAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryANSIDesignation::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryIECDesignationAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryIECDesignation::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryApprovedChemistryAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryApprovedChemistry::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryCapacityAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryCapacity::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryQuantityAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryQuantity::TypeInfo::DecodableArgType); typedef void (*CHIPPowerSourceClusterBatteryChargeStateAttributeCallbackType)( void *, chip::app::Clusters::PowerSource::Attributes::BatteryChargeState::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryTimeToFullChargeAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryTimeToFullCharge::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryFunctionalWhileChargingAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryFunctionalWhileCharging::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryChargingCurrentAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryChargingCurrent::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterActiveBatteryChargeFaultsAttributeCallbackType)( + void *, const chip::app::Clusters::PowerSource::Attributes::ActiveBatteryChargeFaults::TypeInfo::DecodableType &); typedef void (*CHIPPowerSourceClusterGeneratedCommandListAttributeCallbackType)( void *, const chip::app::Clusters::PowerSource::Attributes::GeneratedCommandList::TypeInfo::DecodableType &); typedef void (*CHIPPowerSourceClusterAcceptedCommandListAttributeCallbackType)( diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 6487c19e92b75b..7e9b9239309b30 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -14656,6 +14656,77 @@ void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPPowerSourceActiveWiredFaultsAttributeCallback::CHIPPowerSourceActiveWiredFaultsAttributeCallback(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"); + } +} + +CHIPPowerSourceActiveWiredFaultsAttributeCallback::~CHIPPowerSourceActiveWiredFaultsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPowerSourceActiveWiredFaultsAttributeCallback::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/Integer"; + std::string newElement_0CtorSignature = "(I)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); +} + CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), @@ -14727,6 +14798,77 @@ void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * cont env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback::CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback( + 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"); + } +} + +CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback::~CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback::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/Integer"; + std::string newElement_0CtorSignature = "(I)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); +} + CHIPPowerSourceGeneratedCommandListAttributeCallback::CHIPPowerSourceGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index d3fdd79023ba34..7085fc021c969e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -6069,6 +6069,36 @@ class CHIPOperationalCredentialsAttributeListAttributeCallback bool keepAlive; }; +class CHIPPowerSourceActiveWiredFaultsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPPowerSourceActiveWiredFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPPowerSourceActiveWiredFaultsAttributeCallback(); + + static void maybeDestroy(CHIPPowerSourceActiveWiredFaultsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPPowerSourceActiveBatteryFaultsAttributeCallback : public chip::Callback::Callback { @@ -6099,6 +6129,36 @@ class CHIPPowerSourceActiveBatteryFaultsAttributeCallback bool keepAlive; }; +class CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback(); + + static void maybeDestroy(CHIPPowerSourceActiveBatteryChargeFaultsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPPowerSourceGeneratedCommandListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 0eb9bf94dec2a4..cebf2c0329e636 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -13628,6 +13628,14 @@ public PowerSourceCluster(long devicePtr, int endpointId) { @Override public native long initWithDevice(long devicePtr, int endpointId); + public interface ActiveWiredFaultsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface ActiveBatteryFaultsAttributeCallback { void onSuccess(List valueList); @@ -13636,6 +13644,14 @@ public interface ActiveBatteryFaultsAttributeCallback { default void onSubscriptionEstablished() {} } + public interface ActiveBatteryChargeFaultsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -13687,6 +13703,80 @@ public void subscribeDescriptionAttribute( subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readWiredAssessedInputVoltageAttribute(LongAttributeCallback callback) { + readWiredAssessedInputVoltageAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredAssessedInputVoltageAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredAssessedInputVoltageAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWiredAssessedInputFrequencyAttribute(IntegerAttributeCallback callback) { + readWiredAssessedInputFrequencyAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredAssessedInputFrequencyAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredAssessedInputFrequencyAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWiredCurrentTypeAttribute(IntegerAttributeCallback callback) { + readWiredCurrentTypeAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredCurrentTypeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredCurrentTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWiredAssessedCurrentAttribute(LongAttributeCallback callback) { + readWiredAssessedCurrentAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredAssessedCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredAssessedCurrentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWiredNominalVoltageAttribute(LongAttributeCallback callback) { + readWiredNominalVoltageAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredNominalVoltageAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredNominalVoltageAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWiredMaximumCurrentAttribute(LongAttributeCallback callback) { + readWiredMaximumCurrentAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredMaximumCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredMaximumCurrentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readWiredPresentAttribute(BooleanAttributeCallback callback) { + readWiredPresentAttribute(chipClusterPtr, callback); + } + + public void subscribeWiredPresentAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWiredPresentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readActiveWiredFaultsAttribute(ActiveWiredFaultsAttributeCallback callback) { + readActiveWiredFaultsAttribute(chipClusterPtr, callback); + } + + public void subscribeActiveWiredFaultsAttribute( + ActiveWiredFaultsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeActiveWiredFaultsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readBatteryVoltageAttribute(LongAttributeCallback callback) { readBatteryVoltageAttribute(chipClusterPtr, callback); } @@ -13723,6 +13813,34 @@ public void subscribeBatteryChargeLevelAttribute( subscribeBatteryChargeLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readBatteryReplacementNeededAttribute(BooleanAttributeCallback callback) { + readBatteryReplacementNeededAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryReplacementNeededAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryReplacementNeededAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryReplaceabilityAttribute(IntegerAttributeCallback callback) { + readBatteryReplaceabilityAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryReplaceabilityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryReplaceabilityAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryPresentAttribute(BooleanAttributeCallback callback) { + readBatteryPresentAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryPresentAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryPresentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readActiveBatteryFaultsAttribute(ActiveBatteryFaultsAttributeCallback callback) { readActiveBatteryFaultsAttribute(chipClusterPtr, callback); } @@ -13732,6 +13850,72 @@ public void subscribeActiveBatteryFaultsAttribute( subscribeActiveBatteryFaultsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readBatteryReplacementDescriptionAttribute(CharStringAttributeCallback callback) { + readBatteryReplacementDescriptionAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryReplacementDescriptionAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryReplacementDescriptionAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryCommonDesignationAttribute(LongAttributeCallback callback) { + readBatteryCommonDesignationAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryCommonDesignationAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryCommonDesignationAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryANSIDesignationAttribute(CharStringAttributeCallback callback) { + readBatteryANSIDesignationAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryANSIDesignationAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryANSIDesignationAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryIECDesignationAttribute(CharStringAttributeCallback callback) { + readBatteryIECDesignationAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryIECDesignationAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryIECDesignationAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryApprovedChemistryAttribute(LongAttributeCallback callback) { + readBatteryApprovedChemistryAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryApprovedChemistryAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryApprovedChemistryAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryCapacityAttribute(LongAttributeCallback callback) { + readBatteryCapacityAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryCapacityAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryCapacityAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryQuantityAttribute(IntegerAttributeCallback callback) { + readBatteryQuantityAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryQuantityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryQuantityAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readBatteryChargeStateAttribute(IntegerAttributeCallback callback) { readBatteryChargeStateAttribute(chipClusterPtr, callback); } @@ -13741,6 +13925,45 @@ public void subscribeBatteryChargeStateAttribute( subscribeBatteryChargeStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } + public void readBatteryTimeToFullChargeAttribute(LongAttributeCallback callback) { + readBatteryTimeToFullChargeAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryTimeToFullChargeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryTimeToFullChargeAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryFunctionalWhileChargingAttribute(BooleanAttributeCallback callback) { + readBatteryFunctionalWhileChargingAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryFunctionalWhileChargingAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryFunctionalWhileChargingAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readBatteryChargingCurrentAttribute(LongAttributeCallback callback) { + readBatteryChargingCurrentAttribute(chipClusterPtr, callback); + } + + public void subscribeBatteryChargingCurrentAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeBatteryChargingCurrentAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readActiveBatteryChargeFaultsAttribute( + ActiveBatteryChargeFaultsAttributeCallback callback) { + readActiveBatteryChargeFaultsAttribute(chipClusterPtr, callback); + } + + public void subscribeActiveBatteryChargeFaultsAttribute( + ActiveBatteryChargeFaultsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeActiveBatteryChargeFaultsAttribute( + chipClusterPtr, callback, minInterval, maxInterval); + } + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { readGeneratedCommandListAttribute(chipClusterPtr, callback); } @@ -13805,6 +14028,57 @@ private native void subscribeDescriptionAttribute( int minInterval, int maxInterval); + private native void readWiredAssessedInputVoltageAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeWiredAssessedInputVoltageAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWiredAssessedInputFrequencyAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeWiredAssessedInputFrequencyAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWiredCurrentTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeWiredCurrentTypeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWiredAssessedCurrentAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeWiredAssessedCurrentAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWiredNominalVoltageAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeWiredNominalVoltageAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWiredMaximumCurrentAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeWiredMaximumCurrentAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readWiredPresentAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeWiredPresentAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readActiveWiredFaultsAttribute( + long chipClusterPtr, ActiveWiredFaultsAttributeCallback callback); + + private native void subscribeActiveWiredFaultsAttribute( + long chipClusterPtr, + ActiveWiredFaultsAttributeCallback callback, + int minInterval, + int maxInterval); + private native void readBatteryVoltageAttribute( long chipClusterPtr, LongAttributeCallback callback); @@ -13829,6 +14103,24 @@ private native void readBatteryChargeLevelAttribute( private native void subscribeBatteryChargeLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readBatteryReplacementNeededAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeBatteryReplacementNeededAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryReplaceabilityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeBatteryReplaceabilityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryPresentAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeBatteryPresentAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + private native void readActiveBatteryFaultsAttribute( long chipClusterPtr, ActiveBatteryFaultsAttributeCallback callback); @@ -13838,12 +14130,90 @@ private native void subscribeActiveBatteryFaultsAttribute( int minInterval, int maxInterval); + private native void readBatteryReplacementDescriptionAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeBatteryReplacementDescriptionAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readBatteryCommonDesignationAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeBatteryCommonDesignationAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryANSIDesignationAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeBatteryANSIDesignationAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readBatteryIECDesignationAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeBatteryIECDesignationAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readBatteryApprovedChemistryAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeBatteryApprovedChemistryAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryCapacityAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeBatteryCapacityAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryQuantityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeBatteryQuantityAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readBatteryChargeStateAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBatteryChargeStateAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readBatteryTimeToFullChargeAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeBatteryTimeToFullChargeAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryFunctionalWhileChargingAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeBatteryFunctionalWhileChargingAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readBatteryChargingCurrentAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeBatteryChargingCurrentAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readActiveBatteryChargeFaultsAttribute( + long chipClusterPtr, ActiveBatteryChargeFaultsAttributeCallback callback); + + private native void subscribeActiveBatteryChargeFaultsAttribute( + long chipClusterPtr, + ActiveBatteryChargeFaultsAttributeCallback callback, + int minInterval, + int maxInterval); + private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index fde320d1f4339f..52460aeb7d11e9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -1708,6 +1708,30 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 2L) { return "Description"; } + if (attributeId == 3L) { + return "WiredAssessedInputVoltage"; + } + if (attributeId == 4L) { + return "WiredAssessedInputFrequency"; + } + if (attributeId == 5L) { + return "WiredCurrentType"; + } + if (attributeId == 6L) { + return "WiredAssessedCurrent"; + } + if (attributeId == 7L) { + return "WiredNominalVoltage"; + } + if (attributeId == 8L) { + return "WiredMaximumCurrent"; + } + if (attributeId == 9L) { + return "WiredPresent"; + } + if (attributeId == 10L) { + return "ActiveWiredFaults"; + } if (attributeId == 11L) { return "BatteryVoltage"; } @@ -1720,12 +1744,54 @@ public static String attributeIdToName(long clusterId, long attributeId) { if (attributeId == 14L) { return "BatteryChargeLevel"; } + if (attributeId == 15L) { + return "BatteryReplacementNeeded"; + } + if (attributeId == 16L) { + return "BatteryReplaceability"; + } + if (attributeId == 17L) { + return "BatteryPresent"; + } if (attributeId == 18L) { return "ActiveBatteryFaults"; } + if (attributeId == 19L) { + return "BatteryReplacementDescription"; + } + if (attributeId == 20L) { + return "BatteryCommonDesignation"; + } + if (attributeId == 21L) { + return "BatteryANSIDesignation"; + } + if (attributeId == 22L) { + return "BatteryIECDesignation"; + } + if (attributeId == 23L) { + return "BatteryApprovedChemistry"; + } + if (attributeId == 24L) { + return "BatteryCapacity"; + } + if (attributeId == 25L) { + return "BatteryQuantity"; + } if (attributeId == 26L) { return "BatteryChargeState"; } + if (attributeId == 27L) { + return "BatteryTimeToFullCharge"; + } + if (attributeId == 28L) { + return "BatteryFunctionalWhileCharging"; + } + if (attributeId == 29L) { + return "BatteryChargingCurrent"; + } + if (attributeId == 30L) { + return "ActiveBatteryChargeFaults"; + } if (attributeId == 65528L) { return "GeneratedCommandList"; } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 13d569ff343e84..b4ae15ef4fb6c2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -4972,6 +4972,31 @@ public void onError(Exception ex) { } } + public static class DelegatedPowerSourceClusterActiveWiredFaultsAttributeCallback + implements ChipClusters.PowerSourceCluster.ActiveWiredFaultsAttributeCallback, + 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 DelegatedPowerSourceClusterActiveBatteryFaultsAttributeCallback implements ChipClusters.PowerSourceCluster.ActiveBatteryFaultsAttributeCallback, DelegatedClusterCallback { @@ -4997,6 +5022,31 @@ public void onError(Exception ex) { } } + public static class DelegatedPowerSourceClusterActiveBatteryChargeFaultsAttributeCallback + implements ChipClusters.PowerSourceCluster.ActiveBatteryChargeFaultsAttributeCallback, + 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 DelegatedPowerSourceClusterGeneratedCommandListAttributeCallback implements ChipClusters.PowerSourceCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 94e529e1a06661..7e6ac932307e5b 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -6310,6 +6310,113 @@ public Map> getReadAttributeMap() { readPowerSourceDescriptionCommandParams); readPowerSourceInteractionInfo.put( "readDescriptionAttribute", readPowerSourceDescriptionAttributeInteractionInfo); + Map readPowerSourceWiredAssessedInputVoltageCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredAssessedInputVoltageAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredAssessedInputVoltageAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceWiredAssessedInputVoltageCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredAssessedInputVoltageAttribute", + readPowerSourceWiredAssessedInputVoltageAttributeInteractionInfo); + Map readPowerSourceWiredAssessedInputFrequencyCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredAssessedInputFrequencyAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredAssessedInputFrequencyAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceWiredAssessedInputFrequencyCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredAssessedInputFrequencyAttribute", + readPowerSourceWiredAssessedInputFrequencyAttributeInteractionInfo); + Map readPowerSourceWiredCurrentTypeCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredCurrentTypeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredCurrentTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceWiredCurrentTypeCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredCurrentTypeAttribute", readPowerSourceWiredCurrentTypeAttributeInteractionInfo); + Map readPowerSourceWiredAssessedCurrentCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredAssessedCurrentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredAssessedCurrentAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceWiredAssessedCurrentCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredAssessedCurrentAttribute", + readPowerSourceWiredAssessedCurrentAttributeInteractionInfo); + Map readPowerSourceWiredNominalVoltageCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredNominalVoltageAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredNominalVoltageAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceWiredNominalVoltageCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredNominalVoltageAttribute", + readPowerSourceWiredNominalVoltageAttributeInteractionInfo); + Map readPowerSourceWiredMaximumCurrentCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredMaximumCurrentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredMaximumCurrentAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceWiredMaximumCurrentCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredMaximumCurrentAttribute", + readPowerSourceWiredMaximumCurrentAttributeInteractionInfo); + Map readPowerSourceWiredPresentCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceWiredPresentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readWiredPresentAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readPowerSourceWiredPresentCommandParams); + readPowerSourceInteractionInfo.put( + "readWiredPresentAttribute", readPowerSourceWiredPresentAttributeInteractionInfo); + Map readPowerSourceActiveWiredFaultsCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceActiveWiredFaultsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readActiveWiredFaultsAttribute( + (ChipClusters.PowerSourceCluster.ActiveWiredFaultsAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPowerSourceClusterActiveWiredFaultsAttributeCallback(), + readPowerSourceActiveWiredFaultsCommandParams); + readPowerSourceInteractionInfo.put( + "readActiveWiredFaultsAttribute", readPowerSourceActiveWiredFaultsAttributeInteractionInfo); Map readPowerSourceBatteryVoltageCommandParams = new LinkedHashMap(); InteractionInfo readPowerSourceBatteryVoltageAttributeInteractionInfo = @@ -6363,6 +6470,46 @@ public Map> getReadAttributeMap() { readPowerSourceInteractionInfo.put( "readBatteryChargeLevelAttribute", readPowerSourceBatteryChargeLevelAttributeInteractionInfo); + Map readPowerSourceBatteryReplacementNeededCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryReplacementNeededAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryReplacementNeededAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readPowerSourceBatteryReplacementNeededCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryReplacementNeededAttribute", + readPowerSourceBatteryReplacementNeededAttributeInteractionInfo); + Map readPowerSourceBatteryReplaceabilityCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryReplaceabilityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryReplaceabilityAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceBatteryReplaceabilityCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryReplaceabilityAttribute", + readPowerSourceBatteryReplaceabilityAttributeInteractionInfo); + Map readPowerSourceBatteryPresentCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryPresentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryPresentAttribute((ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readPowerSourceBatteryPresentCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryPresentAttribute", readPowerSourceBatteryPresentAttributeInteractionInfo); Map readPowerSourceActiveBatteryFaultsCommandParams = new LinkedHashMap(); InteractionInfo readPowerSourceActiveBatteryFaultsAttributeInteractionInfo = @@ -6380,6 +6527,100 @@ public Map> getReadAttributeMap() { readPowerSourceInteractionInfo.put( "readActiveBatteryFaultsAttribute", readPowerSourceActiveBatteryFaultsAttributeInteractionInfo); + Map readPowerSourceBatteryReplacementDescriptionCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryReplacementDescriptionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryReplacementDescriptionAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readPowerSourceBatteryReplacementDescriptionCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryReplacementDescriptionAttribute", + readPowerSourceBatteryReplacementDescriptionAttributeInteractionInfo); + Map readPowerSourceBatteryCommonDesignationCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryCommonDesignationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryCommonDesignationAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryCommonDesignationCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryCommonDesignationAttribute", + readPowerSourceBatteryCommonDesignationAttributeInteractionInfo); + Map readPowerSourceBatteryANSIDesignationCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryANSIDesignationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryANSIDesignationAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readPowerSourceBatteryANSIDesignationCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryANSIDesignationAttribute", + readPowerSourceBatteryANSIDesignationAttributeInteractionInfo); + Map readPowerSourceBatteryIECDesignationCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryIECDesignationAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryIECDesignationAttribute( + (ChipClusters.CharStringAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), + readPowerSourceBatteryIECDesignationCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryIECDesignationAttribute", + readPowerSourceBatteryIECDesignationAttributeInteractionInfo); + Map readPowerSourceBatteryApprovedChemistryCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryApprovedChemistryAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryApprovedChemistryAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryApprovedChemistryCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryApprovedChemistryAttribute", + readPowerSourceBatteryApprovedChemistryAttributeInteractionInfo); + Map readPowerSourceBatteryCapacityCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryCapacityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryCapacityAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryCapacityCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryCapacityAttribute", readPowerSourceBatteryCapacityAttributeInteractionInfo); + Map readPowerSourceBatteryQuantityCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryQuantityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryQuantityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPowerSourceBatteryQuantityCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryQuantityAttribute", readPowerSourceBatteryQuantityAttributeInteractionInfo); Map readPowerSourceBatteryChargeStateCommandParams = new LinkedHashMap(); InteractionInfo readPowerSourceBatteryChargeStateAttributeInteractionInfo = @@ -6394,6 +6635,65 @@ public Map> getReadAttributeMap() { readPowerSourceInteractionInfo.put( "readBatteryChargeStateAttribute", readPowerSourceBatteryChargeStateAttributeInteractionInfo); + Map readPowerSourceBatteryTimeToFullChargeCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryTimeToFullChargeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryTimeToFullChargeAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryTimeToFullChargeCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryTimeToFullChargeAttribute", + readPowerSourceBatteryTimeToFullChargeAttributeInteractionInfo); + Map readPowerSourceBatteryFunctionalWhileChargingCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryFunctionalWhileChargingAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryFunctionalWhileChargingAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readPowerSourceBatteryFunctionalWhileChargingCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryFunctionalWhileChargingAttribute", + readPowerSourceBatteryFunctionalWhileChargingAttributeInteractionInfo); + Map readPowerSourceBatteryChargingCurrentCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceBatteryChargingCurrentAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readBatteryChargingCurrentAttribute( + (ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPowerSourceBatteryChargingCurrentCommandParams); + readPowerSourceInteractionInfo.put( + "readBatteryChargingCurrentAttribute", + readPowerSourceBatteryChargingCurrentAttributeInteractionInfo); + Map readPowerSourceActiveBatteryChargeFaultsCommandParams = + new LinkedHashMap(); + InteractionInfo readPowerSourceActiveBatteryChargeFaultsAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PowerSourceCluster) cluster) + .readActiveBatteryChargeFaultsAttribute( + (ChipClusters.PowerSourceCluster.ActiveBatteryChargeFaultsAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPowerSourceClusterActiveBatteryChargeFaultsAttributeCallback(), + readPowerSourceActiveBatteryChargeFaultsCommandParams); + readPowerSourceInteractionInfo.put( + "readActiveBatteryChargeFaultsAttribute", + readPowerSourceActiveBatteryChargeFaultsAttributeInteractionInfo); Map readPowerSourceGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readPowerSourceGeneratedCommandListAttributeInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 6287afcd15ca3d..1017e4c9fd3ad9 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -4273,6 +4273,54 @@ class ChipClusters: "type": "str", "reportable": True, }, + 0x00000003: { + "attributeName": "WiredAssessedInputVoltage", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, + 0x00000004: { + "attributeName": "WiredAssessedInputFrequency", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, + 0x00000005: { + "attributeName": "WiredCurrentType", + "attributeId": 0x00000005, + "type": "int", + "reportable": True, + }, + 0x00000006: { + "attributeName": "WiredAssessedCurrent", + "attributeId": 0x00000006, + "type": "int", + "reportable": True, + }, + 0x00000007: { + "attributeName": "WiredNominalVoltage", + "attributeId": 0x00000007, + "type": "int", + "reportable": True, + }, + 0x00000008: { + "attributeName": "WiredMaximumCurrent", + "attributeId": 0x00000008, + "type": "int", + "reportable": True, + }, + 0x00000009: { + "attributeName": "WiredPresent", + "attributeId": 0x00000009, + "type": "bool", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "ActiveWiredFaults", + "attributeId": 0x0000000A, + "type": "int", + "reportable": True, + }, 0x0000000B: { "attributeName": "BatteryVoltage", "attributeId": 0x0000000B, @@ -4297,18 +4345,102 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x0000000F: { + "attributeName": "BatteryReplacementNeeded", + "attributeId": 0x0000000F, + "type": "bool", + "reportable": True, + }, + 0x00000010: { + "attributeName": "BatteryReplaceability", + "attributeId": 0x00000010, + "type": "int", + "reportable": True, + }, + 0x00000011: { + "attributeName": "BatteryPresent", + "attributeId": 0x00000011, + "type": "bool", + "reportable": True, + }, 0x00000012: { "attributeName": "ActiveBatteryFaults", "attributeId": 0x00000012, "type": "int", "reportable": True, }, + 0x00000013: { + "attributeName": "BatteryReplacementDescription", + "attributeId": 0x00000013, + "type": "str", + "reportable": True, + }, + 0x00000014: { + "attributeName": "BatteryCommonDesignation", + "attributeId": 0x00000014, + "type": "int", + "reportable": True, + }, + 0x00000015: { + "attributeName": "BatteryANSIDesignation", + "attributeId": 0x00000015, + "type": "str", + "reportable": True, + }, + 0x00000016: { + "attributeName": "BatteryIECDesignation", + "attributeId": 0x00000016, + "type": "str", + "reportable": True, + }, + 0x00000017: { + "attributeName": "BatteryApprovedChemistry", + "attributeId": 0x00000017, + "type": "int", + "reportable": True, + }, + 0x00000018: { + "attributeName": "BatteryCapacity", + "attributeId": 0x00000018, + "type": "int", + "reportable": True, + }, + 0x00000019: { + "attributeName": "BatteryQuantity", + "attributeId": 0x00000019, + "type": "int", + "reportable": True, + }, 0x0000001A: { "attributeName": "BatteryChargeState", "attributeId": 0x0000001A, "type": "int", "reportable": True, }, + 0x0000001B: { + "attributeName": "BatteryTimeToFullCharge", + "attributeId": 0x0000001B, + "type": "int", + "reportable": True, + }, + 0x0000001C: { + "attributeName": "BatteryFunctionalWhileCharging", + "attributeId": 0x0000001C, + "type": "bool", + "reportable": True, + }, + 0x0000001D: { + "attributeName": "BatteryChargingCurrent", + "attributeId": 0x0000001D, + "type": "int", + "reportable": True, + }, + 0x0000001E: { + "attributeName": "ActiveBatteryChargeFaults", + "attributeId": 0x0000001E, + "type": "int", + "reportable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index ef121fd1a886db..11d2ea698311f5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -8167,6 +8167,109 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; return value; } + case Attributes::WiredAssessedInputVoltage::Id: { + using TypeInfo = Attributes::WiredAssessedInputVoltage::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::WiredAssessedInputFrequency::Id: { + using TypeInfo = Attributes::WiredAssessedInputFrequency::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; + } + case Attributes::WiredCurrentType::Id: { + using TypeInfo = Attributes::WiredCurrentType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::WiredAssessedCurrent::Id: { + using TypeInfo = Attributes::WiredAssessedCurrent::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::WiredNominalVoltage::Id: { + using TypeInfo = Attributes::WiredNominalVoltage::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::WiredMaximumCurrent::Id: { + using TypeInfo = Attributes::WiredMaximumCurrent::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::WiredPresent::Id: { + using TypeInfo = Attributes::WiredPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ActiveWiredFaults::Id: { + using TypeInfo = Attributes::ActiveWiredFaults::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 numberWithUnsignedChar: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::BatteryVoltage::Id: { using TypeInfo = Attributes::BatteryVoltage::TypeInfo; TypeInfo::DecodableType cppValue; @@ -8211,6 +8314,39 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } + case Attributes::BatteryReplacementNeeded::Id: { + using TypeInfo = Attributes::BatteryReplacementNeeded::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::BatteryReplaceability::Id: { + using TypeInfo = Attributes::BatteryReplaceability::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::BatteryPresent::Id: { + using TypeInfo = Attributes::BatteryPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } case Attributes::ActiveBatteryFaults::Id: { using TypeInfo = Attributes::ActiveBatteryFaults::TypeInfo; TypeInfo::DecodableType cppValue; @@ -8237,6 +8373,83 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader } return value; } + case Attributes::BatteryReplacementDescription::Id: { + using TypeInfo = Attributes::BatteryReplacementDescription::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::BatteryCommonDesignation::Id: { + using TypeInfo = Attributes::BatteryCommonDesignation::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::BatteryANSIDesignation::Id: { + using TypeInfo = Attributes::BatteryANSIDesignation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::BatteryIECDesignation::Id: { + using TypeInfo = Attributes::BatteryIECDesignation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; + return value; + } + case Attributes::BatteryApprovedChemistry::Id: { + using TypeInfo = Attributes::BatteryApprovedChemistry::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::BatteryCapacity::Id: { + using TypeInfo = Attributes::BatteryCapacity::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::BatteryQuantity::Id: { + using TypeInfo = Attributes::BatteryQuantity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } case Attributes::BatteryChargeState::Id: { using TypeInfo = Attributes::BatteryChargeState::TypeInfo; TypeInfo::DecodableType cppValue; @@ -8248,6 +8461,65 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } + case Attributes::BatteryTimeToFullCharge::Id: { + using TypeInfo = Attributes::BatteryTimeToFullCharge::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::BatteryFunctionalWhileCharging::Id: { + using TypeInfo = Attributes::BatteryFunctionalWhileCharging::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::BatteryChargingCurrent::Id: { + using TypeInfo = Attributes::BatteryChargingCurrent::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::ActiveBatteryChargeFaults::Id: { + using TypeInfo = Attributes::ActiveBatteryChargeFaults::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 numberWithUnsignedChar: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::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 20c86b3bf84bf9..12025fbd91a5e1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -7330,6 +7330,45 @@ } } +void CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge::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 numberWithUnsignedChar: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 CHIPPowerSourceActiveWiredFaultsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -7369,6 +7408,45 @@ } } +void CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge::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 numberWithUnsignedChar: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 CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPPowerSourceGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index d939c3b9a7f02e..c1a32865b5e2e4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -5980,6 +5980,34 @@ class CHIPOperationalCredentialsAttributeListListAttributeCallbackSubscriptionBr SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class CHIPPowerSourceActiveWiredFaultsListAttributeCallbackSubscriptionBridge + : public CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge +{ +public: + CHIPPowerSourceActiveWiredFaultsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -6008,6 +6036,35 @@ class CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackSubscriptionBridge + : public CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge +{ +public: + CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPPowerSourceGeneratedCommandListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 0553ff816b76c8..81c1a29b669f3f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -9041,6 +9041,155 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeWiredAssessedInputVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredAssessedInputVoltageWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredAssessedInputVoltageWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeWiredAssessedInputFrequencyWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredAssessedInputFrequencyWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredAssessedInputFrequencyWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeWiredCurrentTypeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredCurrentTypeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredCurrentTypeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeWiredAssessedCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredAssessedCurrentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredAssessedCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeWiredNominalVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredNominalVoltageWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredNominalVoltageWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeWiredMaximumCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredMaximumCurrentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredMaximumCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeWiredPresentWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeWiredPresentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeWiredPresentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeActiveWiredFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeActiveWiredFaultsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeActiveWiredFaultsWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + - (void)readAttributeBatteryVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; /** @@ -9115,6 +9264,62 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeBatteryReplacementNeededWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryReplacementNeededWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryReplacementNeededWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryReplaceabilityWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryReplaceabilityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryReplaceabilityWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryPresentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryPresentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryPresentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + - (void)readAttributeActiveBatteryFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; /** @@ -9134,6 +9339,137 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeBatteryReplacementDescriptionWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryReplacementDescriptionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryReplacementDescriptionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryCommonDesignationWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryCommonDesignationWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryCommonDesignationWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryANSIDesignationWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryANSIDesignationWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryANSIDesignationWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryIECDesignationWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryIECDesignationWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryIECDesignationWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryApprovedChemistryWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryApprovedChemistryWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryApprovedChemistryWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryCapacityWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryCapacityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryCapacityWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryQuantityWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryQuantityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryQuantityWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + - (void)readAttributeBatteryChargeStateWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; /** @@ -9152,6 +9488,82 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeBatteryTimeToFullChargeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryTimeToFullChargeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryTimeToFullChargeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryFunctionalWhileChargingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryFunctionalWhileChargingWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryFunctionalWhileChargingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeBatteryChargingCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeBatteryChargingCurrentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeBatteryChargingCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeActiveBatteryChargeFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeActiveBatteryChargeFaultsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler; ++ (void)readAttributeActiveBatteryChargeFaultsWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; + - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; /** diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 7a956c223a26af..e47b7304ea8552 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -34761,23 +34761,24 @@ new CHIPCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable }); } -- (void)readAttributeBatteryVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)readAttributeWiredAssessedInputVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler { new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeBatteryVoltageWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeWiredAssessedInputVoltageWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler { new CHIPInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, @@ -34786,7 +34787,7 @@ new CHIPInt32uAttributeCallbackSubscriptionBridge( // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, @@ -34798,16 +34799,16 @@ new CHIPInt32uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } -+ (void)readAttributeBatteryVoltageWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler ++ (void)readAttributeWiredAssessedInputVoltageWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler { new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -34823,24 +34824,86 @@ new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s }); } -- (void)readAttributeBatteryPercentRemainingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)readAttributeWiredAssessedInputFrequencyWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeWiredAssessedInputFrequencyWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPInt16uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeWiredAssessedInputFrequencyWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeWiredCurrentTypeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler { new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredCurrentType::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeBatteryPercentRemainingWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))reportHandler +- (void)subscribeAttributeWiredCurrentTypeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { new CHIPInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, @@ -34849,7 +34912,7 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredCurrentType::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, @@ -34861,16 +34924,16 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } -+ (void)readAttributeBatteryPercentRemainingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler ++ (void)readAttributeWiredCurrentTypeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredCurrentType::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -34886,18 +34949,18 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su }); } -- (void)readAttributeBatteryTimeRemainingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, +- (void)readAttributeWiredAssessedCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredAssessedCurrent::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeBatteryTimeRemainingWithMinInterval:(NSNumber * _Nonnull)minInterval +- (void)subscribeAttributeWiredAssessedCurrentWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(CHIPSubscribeParams * _Nullable)params subscriptionEstablished: @@ -34912,7 +34975,7 @@ new CHIPInt32uAttributeCallbackSubscriptionBridge( // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredAssessedCurrent::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, @@ -34924,7 +34987,7 @@ new CHIPInt32uAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } -+ (void)readAttributeBatteryTimeRemainingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer ++ (void)readAttributeWiredAssessedCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler: @@ -34933,7 +34996,7 @@ + (void)readAttributeBatteryTimeRemainingWithAttributeCache:(CHIPAttributeCacheC new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredAssessedCurrent::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); @@ -34949,59 +35012,60 @@ new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s }); } -- (void)readAttributeBatteryChargeLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)readAttributeWiredNominalVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; - auto successFn = Callback::FromCancelable(success); + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::WiredNominalVoltage::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeBatteryChargeLevelWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeWiredNominalVoltageWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = PowerSource::Attributes::WiredNominalVoltage::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, subscriptionEstablishedHandler); } -+ (void)readAttributeBatteryChargeLevelWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler ++ (void)readAttributeWiredNominalVoltageWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredNominalVoltage::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -35011,124 +35075,121 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su }); } -- (void)readAttributeActiveBatteryFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, +- (void)readAttributeWiredMaximumCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge( - self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::WiredMaximumCurrent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } -- (void)subscribeAttributeActiveBatteryFaultsWithMinInterval:(NSNumber * _Nonnull)minInterval +- (void)subscribeAttributeWiredMaximumCurrentWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(CHIPSubscribeParams * _Nullable)params subscriptionEstablished: (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackSubscriptionBridge( + new CHIPInt32uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = PowerSource::Attributes::WiredMaximumCurrent::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, subscriptionEstablishedHandler); } -+ (void)readAttributeActiveBatteryFaultsWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer ++ (void)readAttributeWiredMaximumCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge( - queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredMaximumCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); } - return CHIP_ERROR_NOT_FOUND; - }); + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } -- (void)readAttributeBatteryChargeStateWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)readAttributeWiredPresentWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; - auto successFn = Callback::FromCancelable(success); + new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::WiredPresent::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeBatteryChargeStateWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeWiredPresentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPBooleanAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { // We don't support disabling auto-resubscribe. return CHIP_ERROR_INVALID_ARGUMENT; } - using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = PowerSource::Attributes::WiredPresent::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPBooleanAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, subscriptionEstablishedHandler); } -+ (void)readAttributeBatteryChargeStateWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler ++ (void)readAttributeWiredPresentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPBooleanAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; + using TypeInfo = PowerSource::Attributes::WiredPresent::TypeInfo; path.mEndpointId = static_cast([endpoint unsignedShortValue]); path.mClusterId = TypeInfo::GetClusterId(); path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -35138,6 +35199,1328 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su }); } +- (void)readAttributeActiveWiredFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::ActiveWiredFaults::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeActiveWiredFaultsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPPowerSourceActiveWiredFaultsListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::ActiveWiredFaults::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPPowerSourceActiveWiredFaultsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeActiveWiredFaultsWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceActiveWiredFaultsListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::ActiveWiredFaults::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryVoltageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryVoltageWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryVoltageWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryPercentRemainingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryPercentRemainingWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryPercentRemainingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryTimeRemainingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryTimeRemainingWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryTimeRemainingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryChargeLevelWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryChargeLevelWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryChargeLevelWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryReplacementNeededWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryReplacementNeeded::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryReplacementNeededWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPBooleanAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryReplacementNeeded::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPBooleanAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryReplacementNeededWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPBooleanAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryReplacementNeeded::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryReplaceabilityWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryReplaceability::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryReplaceabilityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryReplaceability::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryReplaceabilityWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryReplaceability::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryPresentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryPresent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryPresentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPBooleanAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryPresent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPBooleanAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryPresentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPBooleanAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryPresent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeActiveBatteryFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeActiveBatteryFaultsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeActiveBatteryFaultsWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceActiveBatteryFaultsListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryReplacementDescriptionWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryReplacementDescription::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryReplacementDescriptionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPCharStringAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryReplacementDescription::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryReplacementDescriptionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryReplacementDescription::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryCommonDesignationWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryCommonDesignation::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryCommonDesignationWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryCommonDesignation::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryCommonDesignationWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryCommonDesignation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryANSIDesignationWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryANSIDesignation::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryANSIDesignationWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPCharStringAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryANSIDesignation::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryANSIDesignationWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryANSIDesignation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryIECDesignationWithCompletionHandler:(void (^)(NSString * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPCharStringAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryIECDesignation::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryIECDesignationWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPCharStringAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryIECDesignation::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPCharStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryIECDesignationWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSString * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPCharStringAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryIECDesignation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryApprovedChemistryWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryApprovedChemistry::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryApprovedChemistryWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryApprovedChemistry::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryApprovedChemistryWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryApprovedChemistry::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryCapacityWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryCapacity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryCapacityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryCapacity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryCapacityWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryCapacity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryQuantityWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryQuantity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryQuantityWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryQuantity::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryQuantityWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryQuantity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryChargeStateWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryChargeStateWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryChargeStateWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryTimeToFullChargeWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryTimeToFullCharge::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryTimeToFullChargeWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryTimeToFullCharge::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryTimeToFullChargeWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryTimeToFullCharge::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryFunctionalWhileChargingWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryFunctionalWhileCharging::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryFunctionalWhileChargingWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPBooleanAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryFunctionalWhileCharging::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPBooleanAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryFunctionalWhileChargingWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPBooleanAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryFunctionalWhileCharging::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeBatteryChargingCurrentWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::BatteryChargingCurrent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeBatteryChargingCurrentWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::BatteryChargingCurrent::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeBatteryChargingCurrentWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatteryChargingCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeActiveBatteryChargeFaultsWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = PowerSource::Attributes::ActiveBatteryChargeFaults::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeActiveBatteryChargeFaultsWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler +{ + new CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = PowerSource::Attributes::ActiveBatteryChargeFaults::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeActiveBatteryChargeFaultsWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPPowerSourceActiveBatteryChargeFaultsListAttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::ActiveBatteryChargeFaults::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h index f5a0ebf1e25ae0..afcdd348439d88 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.h @@ -851,14 +851,50 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeOrderWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredAssessedInputVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredAssessedInputFrequencyWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredCurrentTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredAssessedCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredNominalVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredMaximumCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeWiredPresentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActiveWiredFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeBatteryVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeBatteryPercentRemainingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeBatteryTimeRemainingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeBatteryChargeLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryReplacementNeededWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryReplaceabilityWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryPresentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeActiveBatteryFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryReplacementDescriptionWithValue:(NSString * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryCommonDesignationWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryANSIDesignationWithValue:(NSString * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryIECDesignationWithValue:(NSString * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryApprovedChemistryWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryCapacityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryQuantityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeBatteryChargeStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryTimeToFullChargeWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryFunctionalWhileChargingWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeBatteryChargingCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeActiveBatteryChargeFaultsWithValue:(NSArray * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAcceptedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm index 2d08885cf28f64..4b7419edf6ffee 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -11170,6 +11170,173 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeWiredAssessedInputVoltageWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWiredAssessedInputFrequencyWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWiredCurrentTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredCurrentType::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWiredAssessedCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredAssessedCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWiredNominalVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredNominalVoltage::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWiredMaximumCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredMaximumCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeWiredPresentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::WiredPresent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActiveWiredFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::ActiveWiredFaults::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeBatteryVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11243,6 +11410,62 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeBatteryReplacementNeededWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryReplacementNeeded::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryReplaceabilityWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryReplaceability::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryPresentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryPresent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeActiveBatteryFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11282,6 +11505,137 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeBatteryReplacementDescriptionWithValue:(NSString * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryReplacementDescription::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryCommonDesignationWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryCommonDesignation::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryANSIDesignationWithValue:(NSString * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryANSIDesignation::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryIECDesignationWithValue:(NSString * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryIECDesignation::TypeInfo; + TypeInfo::Type cppValue; + cppValue = [self asCharSpan:value]; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryApprovedChemistryWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryApprovedChemistry::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryCapacityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryCapacity::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryQuantityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryQuantity::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeBatteryChargeStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11300,6 +11654,103 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeBatteryTimeToFullChargeWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryTimeToFullCharge::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryFunctionalWhileChargingWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryFunctionalWhileCharging::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeBatteryChargingCurrentWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::BatteryChargingCurrent::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedIntValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeActiveBatteryChargeFaultsWithValue:(NSArray * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = PowerSource::Attributes::ActiveBatteryChargeFaults::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedCharValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeGeneratedCommandListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( diff --git a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h index f79f8005191590..9b0741b2e8799d 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/cluster/Commands.h @@ -43660,6 +43660,575 @@ class SubscribeAttributePowerSourceDescription : public SubscribeAttribute { } }; +/* + * Attribute WiredAssessedInputVoltage + */ +class ReadPowerSourceWiredAssessedInputVoltage : public ReadAttribute { +public: + ReadPowerSourceWiredAssessedInputVoltage() + : ReadAttribute("wired-assessed-input-voltage") + { + } + + ~ReadPowerSourceWiredAssessedInputVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000003) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeWiredAssessedInputVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredAssessedInputVoltage read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredAssessedInputVoltage : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredAssessedInputVoltage() + : SubscribeAttribute("wired-assessed-input-voltage") + { + } + + ~SubscribeAttributePowerSourceWiredAssessedInputVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000003) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredAssessedInputVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredAssessedInputFrequency + */ +class ReadPowerSourceWiredAssessedInputFrequency : public ReadAttribute { +public: + ReadPowerSourceWiredAssessedInputFrequency() + : ReadAttribute("wired-assessed-input-frequency") + { + } + + ~ReadPowerSourceWiredAssessedInputFrequency() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000004) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeWiredAssessedInputFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredAssessedInputFrequency read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredAssessedInputFrequency : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredAssessedInputFrequency() + : SubscribeAttribute("wired-assessed-input-frequency") + { + } + + ~SubscribeAttributePowerSourceWiredAssessedInputFrequency() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000004) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredAssessedInputFrequencyWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredCurrentType + */ +class ReadPowerSourceWiredCurrentType : public ReadAttribute { +public: + ReadPowerSourceWiredCurrentType() + : ReadAttribute("wired-current-type") + { + } + + ~ReadPowerSourceWiredCurrentType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000005) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredCurrentTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredCurrentType read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredCurrentType : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredCurrentType() + : SubscribeAttribute("wired-current-type") + { + } + + ~SubscribeAttributePowerSourceWiredCurrentType() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000005) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeWiredCurrentTypeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredAssessedCurrent + */ +class ReadPowerSourceWiredAssessedCurrent : public ReadAttribute { +public: + ReadPowerSourceWiredAssessedCurrent() + : ReadAttribute("wired-assessed-current") + { + } + + ~ReadPowerSourceWiredAssessedCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000006) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredAssessedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredAssessedCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredAssessedCurrent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredAssessedCurrent() + : SubscribeAttribute("wired-assessed-current") + { + } + + ~SubscribeAttributePowerSourceWiredAssessedCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000006) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredAssessedCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredNominalVoltage + */ +class ReadPowerSourceWiredNominalVoltage : public ReadAttribute { +public: + ReadPowerSourceWiredNominalVoltage() + : ReadAttribute("wired-nominal-voltage") + { + } + + ~ReadPowerSourceWiredNominalVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000007) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredNominalVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredNominalVoltage read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredNominalVoltage : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredNominalVoltage() + : SubscribeAttribute("wired-nominal-voltage") + { + } + + ~SubscribeAttributePowerSourceWiredNominalVoltage() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000007) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredNominalVoltageWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredMaximumCurrent + */ +class ReadPowerSourceWiredMaximumCurrent : public ReadAttribute { +public: + ReadPowerSourceWiredMaximumCurrent() + : ReadAttribute("wired-maximum-current") + { + } + + ~ReadPowerSourceWiredMaximumCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000008) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredMaximumCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredMaximumCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredMaximumCurrent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredMaximumCurrent() + : SubscribeAttribute("wired-maximum-current") + { + } + + ~SubscribeAttributePowerSourceWiredMaximumCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000008) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeWiredMaximumCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute WiredPresent + */ +class ReadPowerSourceWiredPresent : public ReadAttribute { +public: + ReadPowerSourceWiredPresent() + : ReadAttribute("wired-present") + { + } + + ~ReadPowerSourceWiredPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000009) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeWiredPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredPresent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource WiredPresent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceWiredPresent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceWiredPresent() + : SubscribeAttribute("wired-present") + { + } + + ~SubscribeAttributePowerSourceWiredPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000009) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeWiredPresentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.WiredPresent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ActiveWiredFaults + */ +class ReadPowerSourceActiveWiredFaults : public ReadAttribute { +public: + ReadPowerSourceActiveWiredFaults() + : ReadAttribute("active-wired-faults") + { + } + + ~ReadPowerSourceActiveWiredFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeActiveWiredFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ActiveWiredFaults read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceActiveWiredFaults : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceActiveWiredFaults() + : SubscribeAttribute("active-wired-faults") + { + } + + ~SubscribeAttributePowerSourceActiveWiredFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeActiveWiredFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /* * Attribute BatteryVoltage */ @@ -43945,49 +44514,50 @@ class SubscribeAttributePowerSourceBatteryChargeLevel : public SubscribeAttribut }; /* - * Attribute ActiveBatteryFaults + * Attribute BatteryReplacementNeeded */ -class ReadPowerSourceActiveBatteryFaults : public ReadAttribute { +class ReadPowerSourceBatteryReplacementNeeded : public ReadAttribute { public: - ReadPowerSourceActiveBatteryFaults() - : ReadAttribute("active-battery-faults") + ReadPowerSourceBatteryReplacementNeeded() + : ReadAttribute("battery-replacement-needed") { } - ~ReadPowerSourceActiveBatteryFaults() {} + ~ReadPowerSourceBatteryReplacementNeeded() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000000F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); - err = [CHIPError errorToCHIPErrorCode:error]; + [cluster + readAttributeBatteryReplacementNeededWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementNeeded response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; - if (error != nil) { - ChipLogError(chipTool, "PowerSource ActiveBatteryFaults read Error: %s", chip::ErrorStr(err)); - } - SetCommandExitStatus(err); - }]; + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryReplacementNeeded read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; return err; } }; -class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribute { +class SubscribeAttributePowerSourceBatteryReplacementNeeded : public SubscribeAttribute { public: - SubscribeAttributePowerSourceActiveBatteryFaults() - : SubscribeAttribute("active-battery-faults") + SubscribeAttributePowerSourceBatteryReplacementNeeded() + : SubscribeAttribute("battery-replacement-needed") { } - ~SubscribeAttributePowerSourceActiveBatteryFaults() {} + ~SubscribeAttributePowerSourceBatteryReplacementNeeded() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000012) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000000F) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; @@ -43995,16 +44565,17 @@ class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribu = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; [cluster - subscribeAttributeActiveBatteryFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + subscribeAttributeBatteryReplacementNeededWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementNeeded response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -44016,30 +44587,30 @@ class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribu }; /* - * Attribute BatteryChargeState + * Attribute BatteryReplaceability */ -class ReadPowerSourceBatteryChargeState : public ReadAttribute { +class ReadPowerSourceBatteryReplaceability : public ReadAttribute { public: - ReadPowerSourceBatteryChargeState() - : ReadAttribute("battery-charge-state") + ReadPowerSourceBatteryReplaceability() + : ReadAttribute("battery-replaceability") { } - ~ReadPowerSourceBatteryChargeState() {} + ~ReadPowerSourceBatteryReplaceability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIP_ERROR __block err = CHIP_NO_ERROR; - [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); + [cluster readAttributeBatteryReplaceabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplaceability response %@", [value description]); err = [CHIPError errorToCHIPErrorCode:error]; if (error != nil) { - ChipLogError(chipTool, "PowerSource BatteryChargeState read Error: %s", chip::ErrorStr(err)); + ChipLogError(chipTool, "PowerSource BatteryReplaceability read Error: %s", chip::ErrorStr(err)); } SetCommandExitStatus(err); }]; @@ -44047,35 +44618,1039 @@ class ReadPowerSourceBatteryChargeState : public ReadAttribute { } }; -class SubscribeAttributePowerSourceBatteryChargeState : public SubscribeAttribute { +class SubscribeAttributePowerSourceBatteryReplaceability : public SubscribeAttribute { public: - SubscribeAttributePowerSourceBatteryChargeState() - : SubscribeAttribute("battery-charge-state") + SubscribeAttributePowerSourceBatteryReplaceability() + : SubscribeAttribute("battery-replaceability") { } - ~SubscribeAttributePowerSourceBatteryChargeState() {} + ~SubscribeAttributePowerSourceBatteryReplaceability() {} CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001A) on endpoint %u", endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000010) on endpoint %u", endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; params.keepPreviousSubscriptions = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster - subscribeAttributeBatteryChargeStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); - if (error || !mWait) { - SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); - } - }]; + [cluster subscribeAttributeBatteryReplaceabilityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplaceability response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryPresent + */ +class ReadPowerSourceBatteryPresent : public ReadAttribute { +public: + ReadPowerSourceBatteryPresent() + : ReadAttribute("battery-present") + { + } + + ~ReadPowerSourceBatteryPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000011) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryPresent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryPresent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryPresent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryPresent() + : SubscribeAttribute("battery-present") + { + } + + ~SubscribeAttributePowerSourceBatteryPresent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000011) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryPresentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryPresent response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ActiveBatteryFaults + */ +class ReadPowerSourceActiveBatteryFaults : public ReadAttribute { +public: + ReadPowerSourceActiveBatteryFaults() + : ReadAttribute("active-battery-faults") + { + } + + ~ReadPowerSourceActiveBatteryFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000012) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ActiveBatteryFaults read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceActiveBatteryFaults : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceActiveBatteryFaults() + : SubscribeAttribute("active-battery-faults") + { + } + + ~SubscribeAttributePowerSourceActiveBatteryFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000012) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeActiveBatteryFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryFaults response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryReplacementDescription + */ +class ReadPowerSourceBatteryReplacementDescription : public ReadAttribute { +public: + ReadPowerSourceBatteryReplacementDescription() + : ReadAttribute("battery-replacement-description") + { + } + + ~ReadPowerSourceBatteryReplacementDescription() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000013) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryReplacementDescriptionWithCompletionHandler:^( + NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementDescription response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryReplacementDescription read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryReplacementDescription : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryReplacementDescription() + : SubscribeAttribute("battery-replacement-description") + { + } + + ~SubscribeAttributePowerSourceBatteryReplacementDescription() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000013) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryReplacementDescriptionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryReplacementDescription response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryCommonDesignation + */ +class ReadPowerSourceBatteryCommonDesignation : public ReadAttribute { +public: + ReadPowerSourceBatteryCommonDesignation() + : ReadAttribute("battery-common-designation") + { + } + + ~ReadPowerSourceBatteryCommonDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000014) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryCommonDesignationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCommonDesignation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryCommonDesignation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryCommonDesignation : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryCommonDesignation() + : SubscribeAttribute("battery-common-designation") + { + } + + ~SubscribeAttributePowerSourceBatteryCommonDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000014) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryCommonDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCommonDesignation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryANSIDesignation + */ +class ReadPowerSourceBatteryANSIDesignation : public ReadAttribute { +public: + ReadPowerSourceBatteryANSIDesignation() + : ReadAttribute("battery-ansidesignation") + { + } + + ~ReadPowerSourceBatteryANSIDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000015) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryANSIDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryANSIDesignation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryANSIDesignation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryANSIDesignation : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryANSIDesignation() + : SubscribeAttribute("battery-ansidesignation") + { + } + + ~SubscribeAttributePowerSourceBatteryANSIDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000015) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryANSIDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryANSIDesignation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryIECDesignation + */ +class ReadPowerSourceBatteryIECDesignation : public ReadAttribute { +public: + ReadPowerSourceBatteryIECDesignation() + : ReadAttribute("battery-iecdesignation") + { + } + + ~ReadPowerSourceBatteryIECDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000016) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryIECDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryIECDesignation response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryIECDesignation read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryIECDesignation : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryIECDesignation() + : SubscribeAttribute("battery-iecdesignation") + { + } + + ~SubscribeAttributePowerSourceBatteryIECDesignation() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000016) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryIECDesignationWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryIECDesignation response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryApprovedChemistry + */ +class ReadPowerSourceBatteryApprovedChemistry : public ReadAttribute { +public: + ReadPowerSourceBatteryApprovedChemistry() + : ReadAttribute("battery-approved-chemistry") + { + } + + ~ReadPowerSourceBatteryApprovedChemistry() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000017) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryApprovedChemistryWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryApprovedChemistry response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryApprovedChemistry read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryApprovedChemistry : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryApprovedChemistry() + : SubscribeAttribute("battery-approved-chemistry") + { + } + + ~SubscribeAttributePowerSourceBatteryApprovedChemistry() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000017) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryApprovedChemistryWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryApprovedChemistry response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryCapacity + */ +class ReadPowerSourceBatteryCapacity : public ReadAttribute { +public: + ReadPowerSourceBatteryCapacity() + : ReadAttribute("battery-capacity") + { + } + + ~ReadPowerSourceBatteryCapacity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000018) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCapacity response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryCapacity read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryCapacity : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryCapacity() + : SubscribeAttribute("battery-capacity") + { + } + + ~SubscribeAttributePowerSourceBatteryCapacity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000018) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryCapacityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryCapacity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryQuantity + */ +class ReadPowerSourceBatteryQuantity : public ReadAttribute { +public: + ReadPowerSourceBatteryQuantity() + : ReadAttribute("battery-quantity") + { + } + + ~ReadPowerSourceBatteryQuantity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x00000019) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryQuantityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryQuantity response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryQuantity read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryQuantity : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryQuantity() + : SubscribeAttribute("battery-quantity") + { + } + + ~SubscribeAttributePowerSourceBatteryQuantity() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x00000019) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryQuantityWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryQuantity response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryChargeState + */ +class ReadPowerSourceBatteryChargeState : public ReadAttribute { +public: + ReadPowerSourceBatteryChargeState() + : ReadAttribute("battery-charge-state") + { + } + + ~ReadPowerSourceBatteryChargeState() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001A) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryChargeState read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryChargeState : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryChargeState() + : SubscribeAttribute("battery-charge-state") + { + } + + ~SubscribeAttributePowerSourceBatteryChargeState() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001A) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryChargeStateWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargeState response %@", [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryTimeToFullCharge + */ +class ReadPowerSourceBatteryTimeToFullCharge : public ReadAttribute { +public: + ReadPowerSourceBatteryTimeToFullCharge() + : ReadAttribute("battery-time-to-full-charge") + { + } + + ~ReadPowerSourceBatteryTimeToFullCharge() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001B) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeBatteryTimeToFullChargeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryTimeToFullCharge response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryTimeToFullCharge read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryTimeToFullCharge : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryTimeToFullCharge() + : SubscribeAttribute("battery-time-to-full-charge") + { + } + + ~SubscribeAttributePowerSourceBatteryTimeToFullCharge() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001B) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryTimeToFullChargeWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryTimeToFullCharge response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryFunctionalWhileCharging + */ +class ReadPowerSourceBatteryFunctionalWhileCharging : public ReadAttribute { +public: + ReadPowerSourceBatteryFunctionalWhileCharging() + : ReadAttribute("battery-functional-while-charging") + { + } + + ~ReadPowerSourceBatteryFunctionalWhileCharging() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001C) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryFunctionalWhileChargingWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryFunctionalWhileCharging response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryFunctionalWhileCharging read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryFunctionalWhileCharging : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryFunctionalWhileCharging() + : SubscribeAttribute("battery-functional-while-charging") + { + } + + ~SubscribeAttributePowerSourceBatteryFunctionalWhileCharging() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001C) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeBatteryFunctionalWhileChargingWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^( + NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryFunctionalWhileCharging response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute BatteryChargingCurrent + */ +class ReadPowerSourceBatteryChargingCurrent : public ReadAttribute { +public: + ReadPowerSourceBatteryChargingCurrent() + : ReadAttribute("battery-charging-current") + { + } + + ~ReadPowerSourceBatteryChargingCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001D) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster readAttributeBatteryChargingCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargingCurrent response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource BatteryChargingCurrent read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceBatteryChargingCurrent : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceBatteryChargingCurrent() + : SubscribeAttribute("battery-charging-current") + { + } + + ~SubscribeAttributePowerSourceBatteryChargingCurrent() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001D) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeBatteryChargingCurrentWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.BatteryChargingCurrent response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + +/* + * Attribute ActiveBatteryChargeFaults + */ +class ReadPowerSourceActiveBatteryChargeFaults : public ReadAttribute { +public: + ReadPowerSourceActiveBatteryChargeFaults() + : ReadAttribute("active-battery-charge-faults") + { + } + + ~ReadPowerSourceActiveBatteryChargeFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReadAttribute (0x0000001E) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIP_ERROR __block err = CHIP_NO_ERROR; + [cluster + readAttributeActiveBatteryChargeFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryChargeFaults response %@", [value description]); + err = [CHIPError errorToCHIPErrorCode:error]; + + if (error != nil) { + ChipLogError(chipTool, "PowerSource ActiveBatteryChargeFaults read Error: %s", chip::ErrorStr(err)); + } + SetCommandExitStatus(err); + }]; + return err; + } +}; + +class SubscribeAttributePowerSourceActiveBatteryChargeFaults : public SubscribeAttribute { +public: + SubscribeAttributePowerSourceActiveBatteryChargeFaults() + : SubscribeAttribute("active-battery-charge-faults") + { + } + + ~SubscribeAttributePowerSourceActiveBatteryChargeFaults() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000002F) ReportAttribute (0x0000001E) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPPowerSource * cluster = [[CHIPPowerSource alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster + subscribeAttributeActiveBatteryChargeFaultsWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"PowerSource.ActiveBatteryChargeFaults response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus([CHIPError errorToCHIPErrorCode:error]); + } + }]; return CHIP_NO_ERROR; } @@ -77134,6 +78709,22 @@ void registerClusterPowerSource(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(), // @@ -77142,10 +78733,38 @@ void registerClusterPowerSource(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(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index ab53db3ce4a9f9..61b17744c97427 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -803,11 +803,21 @@ void OperationalCredentialsClusterAttributeListListAttributeFilter(chip::TLV::TL chip::Callback::Cancelable * onFailureCallback); typedef void (*OperationalCredentialsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void PowerSourceClusterActiveWiredFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceActiveWiredFaultsListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); void PowerSourceClusterActiveBatteryFaultsListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*PowerSourceActiveBatteryFaultsListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +void PowerSourceClusterActiveBatteryChargeFaultsListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*PowerSourceActiveBatteryChargeFaultsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); void PowerSourceClusterGeneratedCommandListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); From fde90774e3558e04984e78f39d17717afd493b82 Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Sat, 7 May 2022 19:51:36 +0800 Subject: [PATCH 18/19] chip-cert/convert-key: fix writing CHIP TLV format key (#18165) --- src/tools/chip-cert/KeyUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/chip-cert/KeyUtils.cpp b/src/tools/chip-cert/KeyUtils.cpp index 34d3ecc0211b11..f72fce4f255943 100644 --- a/src/tools/chip-cert/KeyUtils.cpp +++ b/src/tools/chip-cert/KeyUtils.cpp @@ -315,7 +315,7 @@ bool WritePrivateKey(const char * fileName, EVP_PKEY * key, KeyFormat keyFmt) } else { - keyToWrite = chipKey.get(); + keyToWrite = serializedKeypair.Bytes(); keyToWriteLen = static_cast(serializedKeypair.Length()); } From 11587f5bf0bb9e621edd4c867c0bc942d804d1ce Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Sat, 7 May 2022 04:52:02 -0700 Subject: [PATCH 19/19] Added CanCastTo() Macros in the OpenSSL Crypto Library Implementation. (#18161) * Added CanCastTo() Macros in the OpenSSL Crypto Library Implementation. * fixed typo --- src/crypto/CHIPCryptoPALOpenSSL.cpp | 30 +++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index 5dcb11024ae4a4..8c59ffeae96ca7 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -512,6 +512,7 @@ CHIP_ERROR HMAC_sha::HMAC_SHA256(const uint8_t * key, size_t key_length, const u HMAC_CTX * mac_ctx = HMAC_CTX_new(); VerifyOrExit(mac_ctx != nullptr, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(CanCastTo(key_length), error = CHIP_ERROR_INVALID_ARGUMENT); error_openssl = HMAC_Init_ex(mac_ctx, Uint8::to_const_uchar(key), static_cast(key_length), EVP_sha256(), nullptr); VerifyOrExit(error_openssl == 1, error = CHIP_ERROR_INTERNAL); @@ -1112,8 +1113,9 @@ P256Keypair::~P256Keypair() CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) { ERR_clear_error(); - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + int csr_length_local = 0; X509_REQ * x509_req = X509_REQ_new(); EVP_PKEY * evp_pkey = nullptr; @@ -1152,6 +1154,10 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & result = X509_REQ_sign(x509_req, evp_pkey, EVP_sha256()); VerifyOrExit(result > 0, error = CHIP_ERROR_INTERNAL); + csr_length_local = i2d_X509_REQ(x509_req, nullptr); + VerifyOrExit(csr_length_local >= 0, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(CanCastTo(csr_length_local), error = CHIP_ERROR_BUFFER_TOO_SMALL); + VerifyOrExit(static_cast(csr_length_local) <= csr_length, error = CHIP_ERROR_BUFFER_TOO_SMALL); csr_length = static_cast(i2d_X509_REQ(x509_req, &out_csr)); exit: @@ -1530,11 +1536,11 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root result = CertificateChainValidationResult::kInternalFrameworkError; - VerifyOrReturnError(rootCertificate != nullptr && rootCertificateLen != 0, + VerifyOrReturnError(rootCertificate != nullptr && rootCertificateLen != 0 && CanCastTo(rootCertificateLen), (result = CertificateChainValidationResult::kRootArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); - VerifyOrReturnError(caCertificate != nullptr && caCertificateLen != 0, + VerifyOrReturnError(caCertificate != nullptr && caCertificateLen != 0 && CanCastTo(caCertificateLen), (result = CertificateChainValidationResult::kICAArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); - VerifyOrReturnError(leafCertificate != nullptr && leafCertificateLen != 0, + VerifyOrReturnError(leafCertificate != nullptr && leafCertificateLen != 0 && CanCastTo(leafCertificateLen), (result = CertificateChainValidationResult::kLeafArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); store = X509_STORE_new(); @@ -1592,7 +1598,9 @@ CHIP_ERROR IsCertificateValidAtIssuance(const ByteSpan & referenceCertificate, c ASN1_TIME * tbeNotAfterTime = nullptr; int result = 0; - VerifyOrReturnError(!referenceCertificate.empty() && !toBeEvaluatedCertificate.empty(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(!referenceCertificate.empty() && CanCastTo(referenceCertificate.size()) && + !toBeEvaluatedCertificate.empty() && CanCastTo(toBeEvaluatedCertificate.size()), + CHIP_ERROR_INVALID_ARGUMENT); x509ReferenceCertificate = d2i_X509(nullptr, &pReferenceCertificate, static_cast(referenceCertificate.size())); VerifyOrExit(x509ReferenceCertificate != nullptr, error = CHIP_ERROR_NO_MEMORY); @@ -1629,7 +1637,7 @@ CHIP_ERROR IsCertificateValidAtCurrentTime(const ByteSpan & certificate) ASN1_TIME * time = nullptr; int result = 0; - VerifyOrReturnError(!certificate.empty(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(!certificate.empty() && CanCastTo(certificate.size()), CHIP_ERROR_INVALID_ARGUMENT); x509Certificate = d2i_X509(nullptr, &pCertificate, static_cast(certificate.size())); VerifyOrExit(x509Certificate != nullptr, error = CHIP_ERROR_NO_MEMORY); @@ -1665,6 +1673,8 @@ CHIP_ERROR ExtractPubkeyFromX509Cert(const ByteSpan & certificate, Crypto::P256P unsigned char ** ppPubkey = &pPubkey; int pkeyLen; + VerifyOrReturnError(!certificate.empty() && CanCastTo(certificate.size()), CHIP_ERROR_INVALID_ARGUMENT); + x509certificate = d2i_X509(nullptr, ppCertificate, static_cast(certificate.size())); VerifyOrExit(x509certificate != nullptr, err = CHIP_ERROR_NO_MEMORY); @@ -1695,13 +1705,15 @@ CHIP_ERROR ExtractKIDFromX509Cert(bool isSKID, const ByteSpan & certificate, Mut const unsigned char ** ppCertificate = &pCertificate; const ASN1_OCTET_STRING * kidString = nullptr; + VerifyOrReturnError(!certificate.empty() && CanCastTo(certificate.size()), CHIP_ERROR_INVALID_ARGUMENT); + x509certificate = d2i_X509(nullptr, ppCertificate, static_cast(certificate.size())); VerifyOrExit(x509certificate != nullptr, err = CHIP_ERROR_NO_MEMORY); kidString = isSKID ? X509_get0_subject_key_id(x509certificate) : X509_get0_authority_key_id(x509certificate); VerifyOrExit(kidString != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(kidString->length <= static_cast(kid.size()), err = CHIP_ERROR_BUFFER_TOO_SMALL); VerifyOrExit(CanCastTo(kidString->length), err = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(static_cast(kidString->length) <= kid.size(), err = CHIP_ERROR_BUFFER_TOO_SMALL); memcpy(kid.data(), kidString->data, static_cast(kidString->length)); @@ -1738,6 +1750,8 @@ CHIP_ERROR ExtractVIDPIDFromX509Cert(const ByteSpan & certificate, AttestationCe int x509EntryCountIdx = 0; AttestationCertVidPid vidpidFromCN; + VerifyOrReturnError(!certificate.empty() && CanCastTo(certificate.size()), CHIP_ERROR_INVALID_ARGUMENT); + x509certificate = d2i_X509(nullptr, &pCertificate, static_cast(certificate.size())); VerifyOrExit(x509certificate != nullptr, err = CHIP_ERROR_NO_MEMORY);